GNU bug report logs -
#60464
29.0.60; Regression - pcomplete-arg fails with argument 'last
Previous Next
Full log
Message #62 received at 60464 <at> debbugs.gnu.org (full text, mbox):
>> (_ (- pcomplete-index (or index 0))))
>> (or offset 0))
>> pcomplete-args)))
>> - (if (stringp arg)
>> + (if (or (stringp arg)
>> + (eq index 'last))
>> arg
>> (propertize
>> - (buffer-substring (pcomplete-begin index offset)
>> - (pcomplete-begin (1- (or index 0)) offset))
>> + (car (split-string (pcomplete-actual-arg index offset)))
>> 'pcomplete-arg-value arg))))
>
> I'm not sure what specific problem this is trying to solve (is it the
> choice of the "index" or is it the precise buffer positions of the
> bounds)?
>
I admit I don't understand your question. It tries to use
pcomplete-actual-arg, which uses buffer-substring, to get the text
representation of the argument. It's not guaranteed to work in all cases,
though, because it simply assumes that arguments are separated by spaces.
But it should be "good enough".
The (eq index 'last) means that when index is 'last we return the
argument, even when it is not a string (or more precisely: when it is a
list of strings, and the code assumes that a non-string arg is a list of
string), because that's in fact what the caller expects (or at least
that's what Eshell expects) in that case: that list is displayed in
*Completions*.
This bug report was last modified 2 years and 152 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.