mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
map!: support variables for keys
This commit is contained in:
@ -178,10 +178,7 @@ Example
|
|||||||
forms)))
|
forms)))
|
||||||
(:prefix
|
(:prefix
|
||||||
(let ((def (pop rest)))
|
(let ((def (pop rest)))
|
||||||
(setq prefix
|
(setq prefix `(vconcat ,prefix (kbd ,def)))
|
||||||
(if (or (symbolp def) (listp def))
|
|
||||||
`(vconcat ,prefix (if (stringp ,def) (kbd ,def) ,def))
|
|
||||||
`(vconcat ,prefix ,(if (stringp def) (kbd def) def))))
|
|
||||||
(when desc
|
(when desc
|
||||||
(push `(doom--keybind-register ,(key-description (eval prefix))
|
(push `(doom--keybind-register ,(key-description (eval prefix))
|
||||||
,desc ',modes)
|
,desc ',modes)
|
||||||
@ -200,11 +197,14 @@ Example
|
|||||||
;; It's a key-def pair
|
;; It's a key-def pair
|
||||||
((or (stringp key)
|
((or (stringp key)
|
||||||
(characterp key)
|
(characterp key)
|
||||||
(vectorp key))
|
(vectorp key)
|
||||||
|
(symbolp key))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(catch 'skip
|
(catch 'skip
|
||||||
(when (stringp key)
|
(cond ((symbolp key)
|
||||||
(setq key (kbd key)))
|
(setq key `(kbd ,key)))
|
||||||
|
((stringp key)
|
||||||
|
(setq key (kbd key))))
|
||||||
(when prefix
|
(when prefix
|
||||||
(setq key (append prefix (list key))))
|
(setq key (append prefix (list key))))
|
||||||
(unless (> (length rest) 0)
|
(unless (> (length rest) 0)
|
||||||
|
Reference in New Issue
Block a user