unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, 74404@debbugs.gnu.org
Subject: bug#74404: [PATCH] Give Completion Preview bindings higher precedence
Date: Sun, 17 Nov 2024 18:31:03 +0100	[thread overview]
Message-ID: <m14j45ix7s.fsf@macbookpro.home> (raw)
In-Reply-To: <jwvserpyefx.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 17 Nov 2024 12:16:29 -0500")

Hi,

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> 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.

I thought about that, but no, we can't easily use that, since the
overlay is not necessarily at point: it is generally at the end of the
symbol, and point may be at the middle of the symbol.

>> 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`.

Indeed, the minor mode is disabled as soon as the completion preview is
dismissed for whatever reason, including moving point elsewhere.

> 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.

That'd be nice, I think.


Thanks,

Eshel





      reply	other threads:[~2024-11-17 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-17 16:30 bug#74404: [PATCH] Give Completion Preview bindings higher precedence Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-17 17:04 ` Eli Zaretskii
2024-11-17 17:16   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-17 17:31     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m14j45ix7s.fsf@macbookpro.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74404@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).