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

From: Gregory Heytings <[email-masked]>
Date: Sun, 01 Jan 2023 17:28:10 +0000

>> After working a bit more on this bug, I concluded that what Stefan 
>> initially suggested, to use the string representation of the value, is 
>> safer than trying to extract the string corresponding to the argument 
>> that the user typed in from the command line.
>
> This approach seems totally wrong to me.
>

Feel free to suggest something else.

>
> You now introduced a third representation.
>

No, there are two representations: pcomplete-arg returns a string 
representation of the value, with that value attached to the string, when 
its caller does not expect a non-string value.

>
> Also the approach is pointless. Why would the caller of the function 
> want to get the string representation, given that the original value is 
> available as text property?
>

Because the pcomplete functions, in particular pcomplete-here-using-help, 
expect strings.

>
> I suggest you go back to the way you implemented this before and return 
> the actual command line string with the value attached as text property. 
> I don't see why that should be less safe. It is just a matter of 
> determining the correct buffer boundaries.
>

Perhaps I should have explained what I mean by "less safe": it is 
unexpectedly complex to compute the correct buffer boundaries in all 
cases.  If you don't believe me, try it yourself.