GNU bug report logs - #74617
30.0.92; ffap-menu always displays the *Completions* buffer

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 30 Nov 2024 07:03:01 UTC

Severity: normal

Found in version 30.0.92

Done: Daniel Mendler <mail <at> daniel-mendler.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74617 <at> debbugs.gnu.org, monnier <at> 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
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Daniel Mendler <mail <at> daniel-mendler.de>
>> Cc: 74617 <at> debbugs.gnu.org,  monnier <at> iro.umontreal.ca
>> Date: Sat, 30 Nov 2024 17:25:07 +0100
>> 
>> Eli Zaretskii <eliz <at> 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




This bug report was last modified 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.