;;; -*- lexical-binding: t; -*- (defmacro define-repeating-key (keymap key cmd &optional desc) "DEF may be a cons cell (DESCRIPTION . FUNC) or a command." `(let ((def ,(if desc `'(,desc ,cmd) `',cmd))) (define-key ,keymap ,key def) (put ',cmd 'repeat-map ',keymap))) (provide 'kj-lib) (macroexpand '(define-repeating-key map "." mc/mark-next-like-this )) (define-repeating-map) (macroexpand '(define-repeating-key map "." mc/mark-next-like-this "→ this"))