GNU bug report logs - #60464
29.0.60; Regression - pcomplete-arg fails with argument 'last

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 1 Jan 2023 10:48:02 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, Eli Zaretskii <eliz <at> gnu.org>, 60464 <at> debbugs.gnu.org, Jim Porter <jporterbugs <at> gmail.com>
Subject: bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last
Date: Wed, 04 Jan 2023 10:56:26 -0500
Gregory Heytings [2023-01-04 15:39:26] wrote:
>> Your implementation with the 'last condition doesn't make sense.
> Can you please try to make it fail?
>> It is not a good idea to treat 'last specially such that we return a
>> different type in this case.
> I'm not the one who wrote that code.  According to my analysis of the code,
> the only place where pcomplete-arg is called with a 'last' argument is
> pcomplete-parse-arguments, where you will see the following:
>
> (defun pcomplete-parse-arguments (&optional expand-p)
>   ...
>   (let ((results (funcall pcomplete-parse-arguments-function)))
>     (when results
>       (setq ...
> 	    pcomplete-stub (pcomplete-arg 'last))
>       (let ...
> 	(if (and (listp pcomplete-stub) ;??
> 		 (not pcomplete-expand-only-p))
> 	    ;; If `pcomplete-stub' is a list, it means it's a list of
>             ;; completions computed during parsing, e.g. Eshell uses
>             ;; that to turn globs into lists of completions.

That's also my understanding.  So I think The Right Fix (or at least The
Better Fix) is to pay no special attention to `last` in `pcomplete-arg`
and instead in the above code of `pcomplete-parse-arguments` to look for
the `pcomplete-arg-value` property.

Maybe for `emacs-29` we can use your patch (with a comment about why
`last` is handled specially pointing to its handling in
`pcomplete-parse-arguments`) and then in `master` we remove this special
handling of `last`?


        Stefan





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.