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, 18 Dec 2022 19:54:44 -0500 Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> 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="14091"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 01:55:18 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 1p74R2-0003RF-U0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 01:55:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p74Qp-00045z-Ih; Sun, 18 Dec 2022 19:55:03 -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 1p74Qo-00045j-8z for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 19:55:02 -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 1p74Qn-0004gr-VO for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 19:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p74Qn-0003RU-Nv for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 19:55:01 -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 00:55:01 +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.167141129713223 (code B ref 59956); Mon, 19 Dec 2022 00:55:01 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 00:54:57 +0000 Original-Received: from localhost ([127.0.0.1]:36856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p74Qi-0003RD-HF for submit@debbugs.gnu.org; Sun, 18 Dec 2022 19:54:56 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p74Qg-0003R6-Od for 59956@debbugs.gnu.org; Sun, 18 Dec 2022 19:54:55 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8427B81B64; Sun, 18 Dec 2022 19:54:48 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 004BF812F7; Sun, 18 Dec 2022 19:54:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671411287; bh=Yw4+BgsoH0/t0X8jHr5GKQXBkklBcU48+qEq654d5Gs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=M8RQVutg/OpjjCdweU1CpxVAk9+CwshWjGrVQB48LClzon7iXjIbOUsQYSCQ4NJew ll2soJlZ7MYVnzFmCmUtLbCEwPivlNXJTq8IYfVOqvw2xevQNj1gXkvFQ9Ps1RulAL HpNWd+bUTZlHQ24RtfCHpzg/eEuYE2it8K46aTo4wEK0heTjjizaMpZQMI2z78drmd d9twtYzBN3M00hgFz4W6GPq5wfejlcPEhL/kgOaJbuO1eMmBHKcXhOgRa0kangpQbt bBxFCukr0EP5+cggJg8ouEilgXZfoKu3UpBu4NvkJ8qqCW0LrcrKbs8u1fjLAIWSbq d7fWwtRgITQNg== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 40B69120F92; Sun, 18 Dec 2022 19:54:46 -0500 (EST) In-Reply-To: <07bcf6a532d0428b9f53@heytings.org> (Gregory Heytings's message of "Fri, 16 Dec 2022 14:28:42 +0000") 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:251386 Archived-At: >> A "general" solution might be the one below > Why not (format "%s" (nth (+ (pcase ...))))? Because I prefer to confine the workaround to those rare cases where we actually need it. >> tho it looks more like a general workaround, I think. > Indeed, I think it would be better if pcomplete could see the > unexpanded argument instead of its expansion. 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. Stefan [1] And we have an "API bug" in this area where Pcomplete can't reliably figure out what the to-be-completed text actually is, BTW.