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 #34 received at 48153 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 48153 <at> debbugs.gnu.org
Subject: Re: bug#48153: 28.0.50; minor mode keymaps should not override keymap
 given to read-from-minibuffer
Date: Tue, 4 May 2021 23:40:41 +0100
Sorry I'm really bad at giving instructions. Here's some additional information.

First of all, this is the entirety of the test init.el.

(defun bad ()
  (interactive)
  (message "BAD !"))

(define-minor-mode test-mode ""
  :keymap
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "C-k") 'bad)
    map))

(define-global-minor-mode test-global-mode test-mode (lambda () (test-mode 1)))

(test-global-mode 1)
(ido-mode 1)
(setf enable-recursive-minibuffers 1)

Once emacs has started, C-x b C-h b should show that C-k is bound to `bad`.

Second of all, in order to get the key map bindings to
read-from-minibuffer overridden on emacs 27, it requires quitting from
switch-to-buffer, and then C-x b C-h b again to see that C-k is bound
to `bad`. In other words, on emacs 27, one has to pop up the
minibuffer twice. On emacs 28, just opening the minibuffer the first
time will see the key bindings overridden. I guess this is why I say
this is a regression on emacs 28 but you said you couldn't reproduce
it. I think both versions are wrong, it's just on emacs 28, it's wrong
in a more obvious way. In any case, I'm not sure if the minor mode
maps should override the key bindings in the keymap given to
read-from-buffer.

Jimmy

On Tue, May 4, 2021 at 5:36 PM Gregory Heytings <gregory <at> heytings.org> wrote:
>
>
> >
> > The minor mode is exactly the same as what you have in your previous
> > email. What actually happens in my regular setup is the key bindings in
> > multiple minor modes override the key map given to read-from-minibuffer.
> > The problem is I don't want to turn off those minor mode as they used to
> > work in the minibuffer in emacs 27 as intended, but not so in emacs 28.
> >
>
> The problem is that, with the test-mode in my previous mail, I cannot
> reproduce the issue.
>
> >
> > One mode is smartparens and another is move-dup.
> >
>
> But neither of these minor modes override C-k, which you mentioned in your
> original bug report?
>
> I tried move-dup, and its four bindings do not override the corresponding
> bindings in the minibuffer, with or without ido-mode.
>
> So I still cannot see the issue you see...




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.