I am trying to define a minor mode that makes 2 keybindings. This is code i am defining it with:
(define-minor-mode parinfer-mode "Uses Parinfer to Format lispy code" :lighter " parinfer" :keymap '(let ((map (make-sparse-keymap))) (define-key map (kbd "C-c t") 'parinfer-mode--toggle) (define-key map (kbd "C-c r") 'parinfer-mode--refresh) map) (if parinfer-mode (parinfer-mode--refresh)))
However, when i later eval
parinfer-mode, those bindings remain undefined, and value of
(67 keymap (45 keymap (99 keymap (32 keymap (114 . parinfer) (116 . parinfer-mode--toggle))))))
What should i change to set keymap the way i want?
P.S. I am not interested in defining mode separately, but in understanding what goes wrong in using an approach described in documentation.