diff options
Diffstat (limited to 'shoshimacs.org')
-rw-r--r-- | shoshimacs.org | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/shoshimacs.org b/shoshimacs.org index b627513..7b75736 100644 --- a/shoshimacs.org +++ b/shoshimacs.org @@ -282,11 +282,11 @@ bit of ergonomics essentially avoiding some parens and quotes 😂 (define-prefix-command (quote ,keymap)) (global-set-key (kbd ,leader) ,keymap) (mapc (lambda (pair) - (define-key ,keymap - (kbd (if (numberp (car pair)) (number-to-string (car pair)) - (symbol-name (car pair)))) - (cadr pair))) - (quote ,(seq-partition pairs 2))))) + (define-key ,keymap + (kbd (if (numberp (car pair)) (number-to-string (car pair)) + (symbol-name (car pair)))) + (cadr pair))) + (quote ,(seq-partition pairs 2))))) (with-map-defkey my-key-map "M-m" 1 delete-other-windows @@ -302,6 +302,7 @@ bit of ergonomics essentially avoiding some parens and quotes 😂 j describe-function k describe-variable n tab-next + p project-prefix-map s consult-git-grep t consult-theme w which-key-mode @@ -738,12 +739,16 @@ elpa. however, at the moment i must install from source: use the built in ~project.el~ api for their features. I've got the ~project-prefix-map~ on the key =p= in [[*with-map-defkey][my-key-map]]. -Interestingly, you have to assign the /actual/ prefix map, not the -symbol to the keybinding. My key macro doesn't evaluate it so it doesn't -quite work. +Interestingly, in order to refer to a a prefix map with a quoted symbol +like you would a command, the keymap must be in the symbol's function +definition place. The ~project.el~ package doesn't do this, which is normally +done with ~define-prefix-command~ (in my experience). In order to make +this prefix map work correctly with the ~with-map-defkey~ macro, we set +the ~symbol-function~ place on the ~project-prefix-map~ to be the value, +the actual keymap structure, of the ~project-prefix-map~ symbol. 😵 #+begin_src emacs-lisp - (define-key my-key-map "p" project-prefix-map) + (setf (symbol-function 'project-prefix-map) project-prefix-map) #+end_src ** version control |