From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Date: Sun, 11 Dec 2022 10:27:42 -0500 Message-ID: References: <83iliiv0yv.fsf@gnu.org> <87mt7u48ul.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26040"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jim Porter , Eli Zaretskii , Augusto Stoffel , 59956@debbugs.gnu.org To: "John Wiegley" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 11 16:28:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4OFR-0006aj-IB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Dec 2022 16:28:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4OFJ-00064Q-6s; Sun, 11 Dec 2022 10:28:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4OFH-00063v-45 for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 10:28:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4OFG-00076m-Sd for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 10:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4OFG-0005Z8-JT for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2022 10:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Dec 2022 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59956 X-GNU-PR-Package: emacs Original-Received: via spool by 59956-submit@debbugs.gnu.org id=B59956.167077247521386 (code B ref 59956); Sun, 11 Dec 2022 15:28:02 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 11 Dec 2022 15:27:55 +0000 Original-Received: from localhost ([127.0.0.1]:46622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4OF9-0005Ys-4J for submit@debbugs.gnu.org; Sun, 11 Dec 2022 10:27:55 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4OF6-0005Yk-Tl for 59956@debbugs.gnu.org; Sun, 11 Dec 2022 10:27:53 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 432CF44076E; Sun, 11 Dec 2022 10:27:47 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 84A04440760; Sun, 11 Dec 2022 10:27:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1670772465; bh=O5edkEN3ozoS1sUPg+/cHE6J5q8iQ1HJ4xKA/L0Fp3I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RbCsgtOX4WlLS27Z8lqMacN93EN92eckKbKBFDx9aUxAr7SCsiB7qMI+Gq5Q4IT2U wZ4vKxEf5HXaHoppI9mw+43/Y8HDbYFsoC1eGMe3lkC4rEeZUSQceMpcgCiOO5GaNB N8KhOq+aqWhN73wD3L+tRmRx58/coIQ4rrFaWDyzn3HCZR08yF+h4dwaGqkbO5PQYB PmXbUD5XYN7e92y0NLG9bK42w9ZQqPakB9jM0GbA9f05oB8h0HkyxS1GqMF0Oiykxf 4KRwXNIXf3i0lEHvtbqxJxSfdiW+mRGQ7sJPrZUMyi5SkIbfbOoQaJ3MClynfBKmIg hJO6t7RXCsUCA== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E4CB31201FF; Sun, 11 Dec 2022 10:27:44 -0500 (EST) In-Reply-To: <87mt7u48ul.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 11 Dec 2022 09:56:18 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250614 Archived-At: 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