Subject: bug#74617: 30.0.92; ffap-menu always displays the *Completions* buffer

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Nov 2024 10:19:34 +0200

> Cc: Stefan Monnier <[email-masked]>
> Date: Sat, 30 Nov 2024 08:02:20 +0100
> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> `ffap-menu' automatically displays the *Completions* buffer by calling
> `minibuffer-completion-help'. If an alternative minibuffer completion
> system like Icomplete or Vertico is used, the *Completions* buffer is
> not needed since the candidates are already displayed in the minibuffer.

That's not what I see here.  Recipe:

  emacs -Q
  M-x icomplete-mode RET
  C-x C-f nt/INSTALL.W64 RET
  M-x ffap-menu RET

I see only the *Completions* buffer, no other display of the
candidates.  What did I miss?

> I propose to either detect these alternative completion systems (e.g.,
> by checking the value of the completing-read-function and/or the mode
> variables) or to provide a way to disable the call to
> `minibuffer-completion-help'.
> 
> Since the same problem is present in tmm.el, maybe a generic solution
> could be provided by minibuffer.el? Option 1: A function
> `minibuffer-completion-help-if-needed' could call
> `minibuffer-completion-help' only if no other completion system is
> detected. Option 2: A new function
> `completing-read-display-help-function' could be added which defaults to
> `minibuffer-completion-help' and which could be set to nil/ignore by
> alternative completion UIs like Vertico. This function could be used by
> tmm/ffap. Option 3: A new variable `minibuffer-inhibit-completion-help'
> could be added which is checked by `minibuffer-completion-help' and
> which could be set to t by alternative completion UIs.

Option 2 is adding complexity to an already devilishly complex code,
so I like it the least.

But first I think we need to understand the problem better; see above.