Subject: bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last

From: Gregory Heytings <[email-masked]>
Date: Wed, 04 Jan 2023 14:36:53 +0000

>> IOW, instead of unconditionally returning arg, we now sometimes (when 
>> arg is not already a string and when index is not last) return the 
>> textual representation of that argument (what the user typed in) with 
>> the value of arg attached to it.
>
> I don't understand the `last` condition.
>
> Could you explain it (e.g. with a concrete example that breaks if you 
> don't include it)?
>

Yes: when index is 'last' returning a non-string (more precisely: a list 
of strings) is allowed (and in fact expected, at least by Eshell).  A 
recipe, in the Emacs repository:

M-x eshell
cd lisp
ls *.el TAB

(Note that there is no SPC before TAB.)

Without the 'last' condition, you don't get what you're supposed to get at 
that point (and what you got with Emacs 27 or 28), namely the list of .el 
files in *Completions*.  Instead you see "Complete, but not unique", and 
you have to press TAB a second time to see the completions.