Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer

From: Daniel Mendler <[email-masked]>
Date: Sat, 30 Nov 2024 09:12:57 +0100

Eli Zaretskii <[email-masked]> writes:

>> Cc: Stefan Monnier <[email-masked]>
>> Date: Sat, 30 Nov 2024 07:42:33 +0100
>> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> The `tmm-add-prompt' function of tmm.el 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. 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 new
>> customization variable `tmm-display-completions' which defaults to t but
>> can be set to nil to disable the call to `minibuffer-completion-help'. I
>> am happy to provide a patch for either of these approaches.
>
> I think the automatic detection is a better default behavior, but
> maybe we could have a variable (not necessarily a defcustom) for users
> who would like to have the old behavior.

See also what I wrote on my ffap bug report. It may make sense to
provide some more general mechanism (auto detection, custom variable,
...) in minibuffer.el which could be used by tmm, ffap and other
packages. For example my GNU ELPA package Jinx faces the same problem -
if default completion is used, `minibuffer-completion-help' should be
called to display the candidates immediately, but not for other
completion UIs.

> Stefan, WDYT?