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

From: Daniel Mendler <[email-masked]>
Date: Wed, 29 Jan 2025 22:43:24 +0100

Drew Adams <[email-masked]> writes:

>> 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' is a redundancy. Minibuffer-related
>> variables are often let-bound around a completion call, which is not
>> correct in a strict sense, since the variable should only hold inside
>> the minibuffer and not for nested completion sessions. 
>
> So it's _not_ really a redundancy.
>
> If what you _want_ for a given completion call
> is to affect everything that transpires during
> that call, i.e., including "nested completions"
> (recursive edits), then binding a dynamic var
> around the call gets you what you want, simply.

This is almost never correct nor desired, as you acknowledge yourself
below. This means that even if the variable is not an exact redundancy,
in the cases where behavior differs, usage of the variable leads to bugs
or incorrect behavior. It is an argument in favor of deprecating the
variable, if the variable can easily be used incorrectly.

>> The completion metadata including the category
>> does not have this problem.
>
> Or this advantage/possibility.
>
> (I do agree that this deep dynamic-var behavior
> is usually not needed or desirable during
> completion.)

Indeed.

>> The deprecation of `minibuffer-completing-file-name' is just
>> one step in the transition to the category mechanism. As I have
>> mentioned the variable `minibuffer-completing-symbol' had been
>> deprecated and has even been removed already.
>
> Meme combat, oui. ;-) Shouldn't have been removed.
> (Also not redundant, for the same reason.)

Again, we disagree about this - I think the deprecation and removal was
the right thing. There does not seem to be a new argument here and it is
up to the Emacs maintainers to decide about this matter anyway.

Daniel