GNU bug report logs -
#48153
28.0.50; minor mode keymaps should not override keymap given to read-from-minibuffer
Previous Next
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
View this message in rfc822 format
Sorry I missed a reproduction step. You have to turn on the minor mode for the minibuffers. In my config there actually is a global minor mode that turns the minor mode on even for the minibuffer.
In Emacs 27, turning the minor mode on inside the minibuffer would not override the key map given to read-from-minibuffer.
I was able to reproduce this on a pristine init.el with just these reproduction steps plus turning the minor mode on for all buffers with a global minor mode.
My emacs has native compilation configured if that helps.
> On 3 May 2021, at 4:15 pm, Gregory Heytings <gregory <at> heytings.org> wrote:
>
>
>>
>> After typing C-x b or C-x C-f, the minor mode maps from the buffer that launched the minibuffer will override the keymap given to `read-from-minibuffer`, this seems to be a regression in emacs 28 master.
>>
>> Reproduction:
>>
>> 1. Turn on `ido-mode`
>> 2. Turn on some minor mode that rebinds `C-k` with `(define-key
>> some-minor-mode-map (kbd "C-k") 'some-func)`
>> 3. C-x b
>> 4. Select a buffer and type C-k
>>
>> Expectation:
>>
>> C-k should be bound to `ido-kill-buffer-at-head` and calls it, but instead `some-func` is called.
>>
>> Since C-k is bound in `ido-completion-map`, and it is given to `read-from-minibuffer`, all the bindings in `ido-completion-map` should take precedence.
>>
>
> Thanks for your bug report. I'm unable to reproduce your recipe on recent versions of the trunk (today, a week ago). I tried
>
> (define-minor-mode test-mode "" :keymap (let ((map (make-sparse-keymap))) (define-key map (kbd "C-k") '(lambda () (interactive) (message "BAD !"))) map))
>
> and C-k is indeed bound to 'ido-kill-buffer-at-head'. I suspect this misbehavior is due to your configuration; if not, could you try to create a recipe starting with emacs -Q?
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.