[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New define-key syntax with custom keymap
From: |
Manuel Uberti |
Subject: |
Re: New define-key syntax with custom keymap |
Date: |
Tue, 19 Oct 2021 16:19:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 19/10/21 16:14, Lars Ingebrigtsen wrote:
I'm not sure I understand what you mean. `define-key' only works in the
current session -- what it does isn't saved anywhere (no matter what
syntax you use for the key binding).
What I mean is that I have this in my init.el:
(define-key mu-keys-mode-map "\C-c\C-n" #'mu-cleanup-buffer)
And I'd like to change it to this:
(define-key mu-keys-mode-map ["C-c C-n"] #'mu-cleanup-buffer)
But, with the first syntax every time I start/restart Emacs, C-c C-n is bound to
mu-cleanup-buffer. Whereas with the second approach, on start/restart
mu-cleanup-buffer is not bound to anything until I explicitly evaluate that
second define-key statement above.
--
Manuel Uberti
www.manueluberti.eu