all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: mr.meowking@tutamail.com
Cc: 72624@debbugs.gnu.org
Subject: bug#72624: 31.0.50; minor-mode-overriding-map-alist doesn't have higher priority than local map, which differs from docs
Date: Mon, 19 Aug 2024 10:52:14 -0400	[thread overview]
Message-ID: <jwvv7zwshbl.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <O4GZ54W--3-9@tutamail.com> (mr meowking's message of "Wed, 14 Aug 2024 17:45:03 +0200 (CEST)")

> ‘minor-mode-overriding-map-alist` should have higher priority than the
> buffer local keymap.

According to my tests, it does.

> (defvar-keymap mk/test-map
> "RET" #'(lambda () (interactive) (message "mk/test-map")))
[...]
> (keymap-set outline-minor-mode-map "<return>" #'(lambda () (interactive)
> (message "outline-minor-mode-map")))

Binding a command to "<return>" is generally a bug.
You should bind it to "RET" instead, unless you really know what
you're doing.

The way the bug manifests itself is exactly in the way you show here.

Emacs will first look for a binding for `return` and if it finds one
it'll use it in preference to a binding for `RET`, regardless of the
relative precedence of the keymaps involved.

[ Side note:

  > ```elisp
  [...]
  > (setq minor-mode-overriding-map-alist '((outline-minor-mode . nil)))
  [...]
  > ```
  
  `minor-mode-overriding-map-alist` is automatically buffer-local, so
  setting it at the toplevel of an ELisp file doesn't make much sense: it
  will set it only in the buffer that happens to be current when you load
  that ELisp file.  ]


        Stefan






  parent reply	other threads:[~2024-08-19 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 15:45 bug#72624: 31.0.50; minor-mode-overriding-map-alist doesn't have higher priority than local map, which differs from docs mr.meowking--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-17 10:05 ` Eli Zaretskii
2024-08-19 14:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-08-19 15:16   ` Meow King via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-31  8:10     ` Eli Zaretskii

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=jwvv7zwshbl.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=72624@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=mr.meowking@tutamail.com \
    /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.