Subject: Re: bug#74404: [PATCH] Give Completion Preview bindings higher precedence

From: Stefan Monnier <[email-masked]>
Date: Sun, 17 Nov 2024 12:16:29 -0500

>> To fix this issue, we need to give the active completion preview
>> bindings higher precedence than keymaps of minor modes that where
>> defined after loading completion-preview.el.  The patch below does that
>> by using minor-mode-overriding-map-alist.  Any thoughts?
>
> Can't you instead use the 'keymap' text or overlay property?  That
> would avoid the "arms race" of precedences.
>
> Adding Stefan, in case he has comments or suggestions.

Assuming the minor mode is disabled as soon as point moves away from the
completion, I wouldn't have a clear preference between `keymap` and
`minor-mode-overriding-map-alist`.

BTW, maybe we should add some notion of minor mode precedence since such
problems are actually fairly common.  We could do something similar to
what we do with `add-hook`, so `add-minor-mode` takes care of obeying
the ordering constraints.

        Stefan