I am trying to emulate buffer-specific keybindings using minor modes as described here.
For an arbitrary buffer, I am trying to call this function:
(defun buffer-set-keys () (interactive) (cl-flet ((foo () (insert "a"))) (define-minor-mode this-buffer-local-mode :init-value nil :key-map '((kbd "M-_") . foo)) (this-buffer-local-mode)))
I'm pretty sure I'm doing something wrong, and in any case when I try
M-_ I get that "
M-_ is not defined". How can I get this right?