From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Date: Sun, 18 Dec 2022 18:15:48 -0800 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=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: John Wiegley , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org To: Gregory Heytings , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 03:16:17 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 1p75hQ-00068M-JG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 03:16:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p75hE-0007pA-5B; Sun, 18 Dec 2022 21:16: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 1p75hC-0007p1-Rk for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 21:16: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 1p75hC-0000fv-Aa for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 21:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p75hB-00048x-VJ for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 21:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2022 02:16: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.167141615715921 (code B ref 59956); Mon, 19 Dec 2022 02:16:01 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 02:15:57 +0000 Original-Received: from localhost ([127.0.0.1]:37181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p75h7-00048j-Ck for submit@debbugs.gnu.org; Sun, 18 Dec 2022 21:15:57 -0500 Original-Received: from mail-pj1-f44.google.com ([209.85.216.44]:56163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p75h5-00048c-Fl for 59956@debbugs.gnu.org; Sun, 18 Dec 2022 21:15:55 -0500 Original-Received: by mail-pj1-f44.google.com with SMTP id u5so7623947pjy.5 for <59956@debbugs.gnu.org>; Sun, 18 Dec 2022 18:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=C7m9TvjS/Ekzx7UgsUXvAuEvGb5FD6YJHCpD611WFWs=; b=Qbafp/IlIzFaHNpqvKu2135Y9tPiklyTTmNSG0CP1VIh0Aolt176dH+ceDXJC5qI73 e2lbBhR/eLhSB9r+6q2jfGVY9z0RPZHyPyDeTCv7l/WcSSlYpXW4HSnYGW1ZAH/kuaD4 bconke7edduaX4xsvFOiQgGXDTyjLdtnFc0QnZJB/Ws+8F0bGGrAJVUideaOQqAPYt1h VtTVK4lM3+s7+WGdpZhZWcaTSnM5lZARItxoMPdGTXg0JXz19Cy4hdps8H8fpBWoFuqC NkGJCKy1j28Mf7dDUgv73VBH6C32P0nFFaWttgLmwY1LHemgDvtXrq6t2mxeT2CSuSjS mGKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=C7m9TvjS/Ekzx7UgsUXvAuEvGb5FD6YJHCpD611WFWs=; b=CsioE7mqlCKM1mHUIIx2GNlShU6pI5SLNQ6aXIFKF3C5vOBddZbwnJVE54Mo1WElFx oyu+qWOKCUBYsSUlVzE+NK6mx6rRk1QMvb9GNipsxAFVhZmbSdqVTHWeNiATT2w122e2 +irH6HxxLlASvQiEtqNLD1SDj9IOoPYTtbBRs4Qltf+CY16G6h9cJSv0e9h3JjAKI9vi KBnExrCGXWIZUyLMIr8RrEkKYUyeFnom9oxZgYLJ51fFR9O+vAe3jebv9Ec6K1TzPIDC 2uG6hHy6VP4Ddpcrn26sO8qRRASbZAmoMp5dqTttgNYEa9cw5/txHS7w71K3ca8OohqN xznA== X-Gm-Message-State: ANoB5plaZ1aHHpdy5hpnUEZwawuXCeGeGP6yYIPfh6BKX7YbNywtvVEv k6wYDqDXNkuENGSL2lGPnug= X-Google-Smtp-Source: AA0mqf64/WUnqu6i8VZ/N7ZSYVuwmtkJhinGlCjkCg3FOI2ISZZ6Mjuq7966FeyGhtQR+n4OS83LbA== X-Received: by 2002:a05:6a20:4d92:b0:ac:16ae:f46 with SMTP id gj18-20020a056a204d9200b000ac16ae0f46mr47244046pzb.15.1671416149495; Sun, 18 Dec 2022 18:15:49 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id s24-20020a63f058000000b00473c36ea150sm5061962pgj.92.2022.12.18.18.15.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Dec 2022 18:15:48 -0800 (PST) Content-Language: en-US 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:251390 Archived-At: On 12/18/2022 5:19 PM, Gregory Heytings wrote: > 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". For external commands called from Eshell, the most-correct thing to do would be to take the list of all arguments, flatten it, and convert every element in the flattened list to a string. That's how Eshell will ultimately call the program. The tricky bit in my mind is how to do that automatically for external commands, but to still allow a Pcomplete function for an Eshell command (i.e. a function named 'eshell/FOO') to have access to the "raw"[1] expanded form, even if it contains sublists, numbers, other objects, etc. Maybe we could just do the first thing above, and then think about adding a new API to Pcomplete that gets the "raw" expanded form for later... [1] Is it really "raw" if variables have been expanded? Probably not. I can't think of a better name at the moment though.