From: Manuel Uberti <manuel.uberti@inventati.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: New define-key syntax with custom keymap
Date: Tue, 19 Oct 2021 07:53:38 +0200 [thread overview]
Message-ID: <a4a7688b-f6d0-3acf-4bf0-49e3da5a703c@inventati.org> (raw)
Hi,
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
www.manueluberti.eu
next reply other threads:[~2021-10-19 5:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 5:53 Manuel Uberti [this message]
2021-10-19 13:52 ` New define-key syntax with custom keymap Lars Ingebrigtsen
2021-10-19 13:54 ` Manuel Uberti
2021-10-19 13:59 ` Manuel Uberti
2021-10-19 14:14 ` Lars Ingebrigtsen
2021-10-19 14:19 ` Manuel Uberti
2021-10-19 14:22 ` Lars Ingebrigtsen
2021-10-19 14:27 ` Manuel Uberti
2021-10-19 14:32 ` Lars Ingebrigtsen
-- strict thread matches above, loose matches on Subject: below --
2021-11-23 6:51 Manuel Uberti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4a7688b-f6d0-3acf-4bf0-49e3da5a703c@inventati.org \
--to=manuel.uberti@inventati.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.