[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New define-key syntax with custom keymap

From: Manuel Uberti
Subject: New define-key syntax with custom keymap
Date: Tue, 19 Oct 2021 07:53:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0


following the recent changes on master, I am trying to use the new syntax to define key bindings. The following works as expected:

(global-set-key ["C-M-z"] #'mu-indent-defun)

But these do not work:

(define-key mu-keys-mode-map ["C-<return>"] #'mu-open-line-below)
(define-key mu-keys-mode-map ["C-c C-n"] #'mu-cleanup-buffer)

Whereas these work as expected:

(define-key mu-keys-mode-map (kbd "C-<return>") #'mu-open-line-below)
(define-key mu-keys-mode-map "\C-c\C-n" #'mu-cleanup-buffer)

For reference, mu-keys-mode-map comes from this code in my init.el:

(defvar mu-keys-mode-map (make-keymap)
  "Keymap for command `mu-keys-mode'.")

(define-minor-mode mu-keys-mode
  "Minor mode for my personal key bindings."
  :init-value t
  :global t
  :keymap mu-keys-mode-map
  :group 'local)

(push `((mu-keys-mode . ,mu-keys-mode-map)) emulation-mode-map-alists)

I am probably missing something, but I don't know what.

Manuel Uberti

reply via email to

[Prev in Thread] Current Thread [Next in Thread]