unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Manuel Uberti <manuel.uberti@inventati.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: New define-key syntax with custom keymap
Date: Tue, 19 Oct 2021 16:19:51 +0200	[thread overview]
Message-ID: <aae3f12c-53bb-d837-f27c-a63c8e239294@inventati.org> (raw)
In-Reply-To: <87bl3ldru0.fsf@gnus.org>

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



  reply	other threads:[~2021-10-19 14:19 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 [this message]
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

  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=aae3f12c-53bb-d837-f27c-a63c8e239294@inventati.org \
    --to=manuel.uberti@inventati.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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).