unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "John Wiegley" <johnw@gnu.org>
Cc: Jim Porter <jporterbugs@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	Augusto Stoffel <arstoffel@gmail.com>,
	59956@debbugs.gnu.org
Subject: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation
Date: Sun, 11 Dec 2022 10:27:42 -0500	[thread overview]
Message-ID: <jwvsfhmklxe.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87mt7u48ul.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 11 Dec 2022 09:56:18 +0100")

Hi John,

As the original designer of both Eshell and Pcomplete, what's your
opinion on the below:

>>> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the 
>>> trailing space), and then hit TAB. The result is this error:
>>> 
>>>    pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...)
>>> 
>>> This is a regression from Emacs 28, and it looks like it's due to 
>>> 'pcomplete-here-using-help' assuming that all the pcomplete args are 
>>> strings. However, 'exec-path' is a list (and Eshell reports it this way 
>>> to pcomplete), so the completion fails. I think all that's necessary is 
>>> checking that the pcomplete args are strings in 
>>> 'pcomplete-here-using-help', but I know next to nothing about pcomplete...
>>
>> Adding Stefan, who should know more about pcomplete.
>> Stefan, any suggestions?
>
> For the record, this problem afflicts just about every pcomplete rule
> (except probably those meant specifically for eshell).  I just tried
> `cvs $echo-path TAB` and I get the same error.

Indeed, it seems to be a pervasive problem.

> The issue here is what eshell returns via (pcomplete-arg ...) etc.
> Currently it can be a list.  How about changing it to the string
> "$echo-path", with the list sneaked in as a text property?

From the point of view of Pcomplete, `pcomplete-arg` should indeed
always return a string, I think.  But should it be the string as it
stands in the buffer or the string *represented* by what's in
the buffer (i.e. after $ expansion and such)?
Should `pcomplete-arg` return nil in a case like `echo $nil`?

For "normal" shells, this is not an issue since they don't really
manipulate anything else than strings (or so we can pretend), but
obviously things aren't that simple for Eshell.


        Stefan






  reply	other threads:[~2022-12-11 15:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11  1:25 bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Jim Porter
2022-12-11  7:44 ` Eli Zaretskii
2022-12-11  8:56   ` Augusto Stoffel
2022-12-11 15:27     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-12 22:21   ` Gregory Heytings
2022-12-12 22:37     ` Augusto Stoffel
2022-12-12 23:27       ` Gregory Heytings
2022-12-16 11:20         ` Augusto Stoffel
2022-12-16  6:09     ` Jim Porter
2022-12-16 14:13       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-16 14:28         ` Gregory Heytings
2022-12-19  0:54           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-19  1:19             ` Gregory Heytings
2022-12-19  2:15               ` Jim Porter
2022-12-19  3:07               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-19 15:00                 ` Gregory Heytings
2022-12-19 16:22                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-19 22:22                     ` Gregory Heytings
2022-12-21  6:32                       ` Jim Porter
2022-12-21  9:28                         ` Gregory Heytings
2022-12-29 22:02                           ` Gregory Heytings
2022-12-19 10:31             ` Augusto Stoffel
2022-12-19 16:21               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-19 18:04               ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsfhmklxe.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59956@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=eliz@gnu.org \
    --cc=johnw@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).