From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Date: Mon, 19 Dec 2022 01:19:32 +0000 Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6771"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 02:20:24 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 1p74pM-0001W6-7b for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 02:20:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p74p2-0007lG-LI; Sun, 18 Dec 2022 20:20:04 -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 1p74p0-0007kr-RB for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 20:20: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 1p74p0-0000En-Il for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 20:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p74oz-0003dk-Uk for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 20:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2022 01:20: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.167141277713981 (code B ref 59956); Mon, 19 Dec 2022 01:20:01 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 01:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:36957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p74ob-0003dR-5O for submit@debbugs.gnu.org; Sun, 18 Dec 2022 20:19:37 -0500 Original-Received: from heytings.org ([95.142.160.155]:36198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p74oZ-0003dL-58 for 59956@debbugs.gnu.org; Sun, 18 Dec 2022 20:19:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1671412773; bh=O5BXT+tPWZtLRXgGzVxC7BLy7sjBhHn4/akGLopVncw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=xceDP1YIMBLeq7CfJQgmonBFj4ePIIIr25WGt9O6gZao0uvtUVCnddSCLsTOZKppt 6DmUjES3oun+X76+A1WGZNtgoLhNacO2PSU74WyKAZo5kTRx/MUficl50l9btl+gOh b3z3lh7p/Oh5TJcDVrfbiUE+y+05nFpP+qJKQ7eidD3XCpikiB70af3oJKczmAhDj/ 2gPAD25V9c9q0T2VWBjsOoTwT7OA6Eg2RRPkPC8mNuOoA2/ZNWeqkA3puKKl2IKMXF nTWbM9Z+ed3MQFS1OffympJz31YwQEIOOeCcZOfMO3HWziKecVOXvZA2vUTEulzgXH X5Lo/E8rYpbfw== In-Reply-To: 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:251388 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. > I see, thanks! And I agree that it's better. >>> 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. > Hmmm... So I guess it would be better, instead of replacing lists (and in general non-strings) by their string representation, and instead of always looking at an unexpanded argument, to look at the unexpanded argument only when the expanded argument is not a string? E.g. if $foo is "-u" we would use "-u", but if $foo is (b a r) we would use "$foo".