Subject: Re: bug#48153: 28.0.50; minor mode keymaps should not override keymap given to read-from-minibuffer
From: Stefan Monnier <[email-masked]>
To: Jimmy Yuen Ho Wong <[email-masked]>
Cc: [email-masked], Gregory Heytings <[email-masked]>, Eli Zaretskii <[email-masked]>
Date: Sun, 09 May 2021 10:57:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> Ok I think I've found a solution to my problem. There are a couple of
> things that I didn't understand and had to attach a function to print
> out which one is being called on 5 different hooks to find out the
> invocation order.
>
> This is call order I've found:
>
> 1. ido-setup-hook
> 2. minibuffer-mode-hook
> 3. minibuffer-setup-hook
> 4. minibuffer-exit-hook
> 5. minibuffer-inactive-mode-hook
>
> Specifically, the override keymaps are cleared between step 1 and 2,
> so if I loop thru the minibuffers in step 1 to assign to
> minor-mode-override-map-alist inside them, they will be reset in step
> 2 I suppose.

Indeed, `ido-setup-hook` is run after IDO has configured its own keymaps
and variables, but hasn't yet entered the minibuffer, so it's too early
to work on `minor-mode-override-map-alist`.

> So if I needed to "unshadow" the shadowed keybindings inside the
> minibuffer, I had to do these processing in minibuffer-setup-hook
> because that is called every time the minibuffer is entered.

That's right.

> Thanks for your help, you can close this issue now.

Closing, thanks,

        Stefan