[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New define-key syntax with custom keymap
From: |
Lars Ingebrigtsen |
Subject: |
Re: New define-key syntax with custom keymap |
Date: |
Tue, 19 Oct 2021 16:22:48 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Manuel Uberti <manuel.uberti@inventati.org> writes:
> 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.
Ah, I see.
I put:
(require 'gnus-sum)
(define-key gnus-summary-mode-map ["C-c C-n"] #'mu-cleanup-buffer)
in my ~/.emacs and started an Emacs and Gnus, and the key was bound in
Gnus summary buffers.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no