Subject: bug#75910: 31; Deprecate minibuffer-completing-file-name

From: Daniel Mendler <[email-masked]>
Date: Wed, 29 Jan 2025 17:29:03 +0100

Stefan Monnier <[email-masked]> writes:

>>>>> I don't understand what's the glaring argument for removing that
>>>>> variable. IIRC, it was requested already a while ago, and this was
>>>>> rejected. What's the change now for doing so?
>>>>
>>>> Can you please point to the relevant discussion? The last time I have
>>>> talked with Stefan Monnier about this variable, the plan was still to
>>>> deprecate this variable in the longer term, with the goal of use the
>>>> completion category as a unifying mechanism.
>>>
>>> But the question remains: What is the benefit removing (deprecating)
>>> this variable?
>>
>> The completion category mechanism is a generalization of various old
>> `minibuffer-completing-*' variables. Completion tables like the file
>> completion table already provide the category, so
>> `minibuffer-completing-file-name'
>
> I think there's a bit of misunderstanding here: IIUC Tramp's use of
> `minibuffer-completing-file-name` is not to check "what are we
> completing?" but rather to check "are we completing?".
> IOW, it's (ab)using that variable to distinguish the case where Tramp is
> used as part of a completion, as opposed to something else.

To be clear, I have not checked every occurrence of the variable, only
that it is used rarely and that the completion category is an
alternative mechanism which can be used as an adequate substitute if we
want to know the type of completion. Otherwise I would have sent a patch
already. If we only want to check if completion is active we can check
other variables.

> IOW, we should clarify exactly what those tests of
> `minibuffer-completing-file-name` actually aim to do, in Tramp's code,
> before we can figure out what to replace them with.

Of course. Again, my proposal of minibuffer-category-p was only a draft
and not a patch. For me the question here is if deprecation of the
variable should be pursued or not.

>         Stefan