From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74617@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#74617: 30.0.92; ffap-menu always displays the *Completions* buffer
Date: Sat, 30 Nov 2024 18:18:43 +0100 [thread overview]
Message-ID: <87ttboiqrw.fsf@daniel-mendler.de> (raw)
In-Reply-To: <86bjxw7j4n.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Nov 2024 18:59:20 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Daniel Mendler <mail@daniel-mendler.de>
>> Cc: 74617@debbugs.gnu.org, monnier@iro.umontreal.ca
>> Date: Sat, 30 Nov 2024 17:25:07 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> I see it differently. The problem is in the tmm and ffap commands which
>> >> lead to a mixture of completion UIs. Even if another completion UI is in
>> >> effect, the default completion UI is called by tmm and ffap, bypassing
>> >> the `completing-read' abstraction.
>> >
>> > I don't understand: ffap-menu calls completing-read, so what
>> > abstraction does it bypass, and how?
>>
>> It also calls `minibuffer-completion-help' which belongs to the default
>> completion UI but not strictly to the abstract `completing-read' API.
>
> So the problem is this single line?
>
> (let ((minibuffer-setup-hook 'minibuffer-completion-help))
Yes.
But maybe it makes sense to tackle the "immediate candidate display
problem" more generally. It would be great to get Stefan's input on
this.
For example in my osm.el package I have the following code to implement
immediate display of candidates. The lambda implements the
auto-detection, which I don't find particularly elegant.
(minibuffer-with-setup-hook
(lambda ()
(when (and (eq completing-read-function #'completing-read-default)
(not (bound-and-true-p vertico-mode))
(not (bound-and-true-p icomplete-mode)))
(let ((message-log-max nil)
(inhibit-message t))
;; Show matches immediately for default completion.
(minibuffer-completion-help))))
(completing-read ...))
Initially I had forgotten the call to `minibuffer-completion-help' since
most of them time I use a completion UI which displays the candidates
automatically anyway. Then Richard reported the bug, that `osm-search'
doesn't work conveniently in Emacs by default. Furthermore in my jinx.el
package I have almost exactly the same code in `jinx--correct-setup',
which is used like this:
(minibuffer-with-setup-hook
#'jinx--correct-setup
(completing-read ...))
Daniel
next prev parent reply other threads:[~2024-11-30 17:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 7:02 bug#74617: 30.0.92; ffap-menu always displays the *Completions* buffer Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 8:19 ` Eli Zaretskii
2024-11-30 8:34 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 9:28 ` Eli Zaretskii
2024-11-30 9:40 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 12:30 ` Eli Zaretskii
2024-11-30 16:25 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 16:59 ` Eli Zaretskii
2024-11-30 17:18 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-11-30 19:09 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 19:13 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 17:46 ` Juri Linkov
2024-11-30 18:39 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 18:58 ` Juri Linkov
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=87ttboiqrw.fsf@daniel-mendler.de \
--to=bug-gnu-emacs@gnu.org \
--cc=74617@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=mail@daniel-mendler.de \
--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).