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: Mon, 19 Dec 2022 11:21:00 -0500 Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <87v8m7heh8.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="26561"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jim Porter , Gregory Heytings , Eli Zaretskii , 59956@debbugs.gnu.org, John Wiegley To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 17:22: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 1p7Iu6-0006h1-27 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 17:22:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Itx-00008J-0C; Mon, 19 Dec 2022 11:22: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 1p7Itv-000086-CE for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:22: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 1p7Itv-0006je-1X for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7Itu-0004OS-It for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:22: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: Mon, 19 Dec 2022 16:22: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.167146687116855 (code B ref 59956); Mon, 19 Dec 2022 16:22:02 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 16:21:11 +0000 Original-Received: from localhost ([127.0.0.1]:39029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7It4-0004Nn-TZ for submit@debbugs.gnu.org; Mon, 19 Dec 2022 11:21:11 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7It3-0004Nd-91 for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 11:21:10 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 81D431007F3; Mon, 19 Dec 2022 11:21:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DFC1E100123; Mon, 19 Dec 2022 11:21:01 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671466861; bh=buSpauQTqOB4NMUYVttx2qD69yRBRM0EkcPkIYDCPIU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oaX05gtS208JV+XGa9gS+fjvSkCoPfYeKsPS9P0pw0rkGcCTbGF4troeB21ZyR1vu cOn0/+eysm0LZq40E9YDSqQ0yhMQm1J9uv1lVL0WWaYLflEbenUSyvhu4yj1tSPMMd petzIKDh4qlnFjt9s0AXBJthNyIot7xcU49rlpbUv05KM/VwHMOcp3SE6CnA+0eokI y+a+vB+/poS0+b386gaLt4iglX4GbPrg0tzACnuiPFOIWbdLl72CakyJCPQ+tXLl3h i8PV+RHj6Zx9gmZEDyC3hSnAzhoojy481rArW5Fu9dE5q3YLDeuaJyCdV7B+nmdBA7 lTYxziHFZuhDg== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A8539120F47; Mon, 19 Dec 2022 11:21:01 -0500 (EST) In-Reply-To: <87v8m7heh8.fsf@gmail.com> (Augusto Stoffel's message of "Mon, 19 Dec 2022 11:31:15 +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:251442 Archived-At: >> There's a tension here: we want the completion to operate on the actual >> buffer text obviously, so in some places we definitely want to see the >> "unexpanded argument" [1], but when it comes to looking at other arguments >> to decide which completion table to use at point, it's often more useful >> to see the expanded arguments (i.e. the thing that the command will >> actually see). E.g. if the previous arg is `$foo` which expands to `-u` >> we'd probably prefer to see `-u` in order to know we should complete >> against user names. > > If $foo is "-u -v"`, your patch will make pcomplete see this as a single > argument, no? I must admit that this gets into detailed semantics of Eshell with which I'm not familiar, but AFAIK if $foo contains a string such as "-u -v", then my patch won't have any effect at all. More generally my patch doesn't change the number of arguments as seen by `pcomplete-arg`. IOW if $foo is turned into several arguments, it's presumably done before those are turned into what Pcomplete sees as "the list of arguments". > I think it makes sense to send the string "$foo" with the list '("-u" > "-v") embedded as text property, and add some convenience functions to > fetch the list for the pcomplete functions that can handle the more > refined information. Could make sense, indeed. I'd be interested to see what a patch for that could look like, tho. Stefan