GNU bug report logs - #48153
28.0.50; minor mode keymaps should not override keymap given to read-from-minibuffer

Previous Next

Package: emacs;

Reported by: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>

Date: Sun, 2 May 2021 07:01:01 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #58 received at 48153 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: Gregory Heytings <gregory <at> heytings.org>, 48153 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#48153: 28.0.50; minor mode keymaps should not override
 keymap given to read-from-minibuffer
Date: Wed, 05 May 2021 10:17:58 -0400
> 1. On emacs 27, minor mode keybindings will only override the key
> bindings given to read-from-minibuffer after the second invocation of
> the minibuffer, but doesn't on the first invocation.

Something like that, yes.
That's only for minor modes defined via `define-globalized-minor-mode`.
Not for global minor modes defined in the usual way via (define-minor-mode
... :global t ...).

This change makes for a more predictable behavior and is a side-effect
of the change described in etc/NEWS as:

    ** An active minibuffer now has major mode 'minibuffer-mode', not the
    erroneous 'minibuffer-inactive-mode' it formerly had.

More specifically, the difference is that in Emacs<28 sometimes those
globalized minor modes where not enabled (hence their keybindings are
not active).

> 2. On emacs 28, minor mode keybindings override the key bindings given
> to read-from-minibuffer at all times.

And this was also true in all previous versions of Emacs.

> 3. But, `minor-mode-overriding-map-alist` does not override the
> override in effect in the minibuffer like other buffers.

That's the part of your bug report I haven't understood yet.

> My expectation is when a keymap is explicitly given to
> read-from-minibuffer, the key bindings in it should take precedence,
> but it doesn't.

No, this keymap is the "local map" a.k.a "major mode map", so it has
lower precedence than minor keymaps.  Always had.

> As you can see from the snippet from my last email, both
> ido-completion-map and test-mode bind to C-k, I expect the C-k binding
> in ido-completion-map to take effect inside the minibuffer, without
> being overridden by any minor modes in effect inside the minibuffer.

This expectation is incorrect ;-)

> If this is not to be desired, I'd expect setting
> minor-mode-overriding-map-alist or the usual key binding lookup search
> algorithm to work inside the minibuffer.

This should be the case: minibuffers are treated exactly like all other
buffers by the keymap code, AFAIK.


        Stefan





This bug report was last modified 4 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.