From: Lars Ingebrigtsen <larsi@gnus.org>
To: Manuel Uberti <manuel.uberti@inventati.org>
Cc: emacs-devel@gnu.org
Subject: Re: New define-key syntax with custom keymap
Date: Tue, 19 Oct 2021 16:22:48 +0200 [thread overview]
Message-ID: <87y26pccw7.fsf@gnus.org> (raw)
In-Reply-To: <aae3f12c-53bb-d837-f27c-a63c8e239294@inventati.org> (Manuel Uberti's message of "Tue, 19 Oct 2021 16:19:51 +0200")
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
next prev parent reply other threads:[~2021-10-19 14:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 5:53 New define-key syntax with custom keymap Manuel Uberti
2021-10-19 13:52 ` 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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y26pccw7.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=manuel.uberti@inventati.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).