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: Mon, 19 Dec 2022 10:04:51 -0800 Message-ID: <64fc569c-6e35-139c-f2bc-e56845e57dc4@gmail.com> References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <87v8m7heh8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32346"; mail-complaints-to="usenet@ciao.gmane.io" Cc: John Wiegley , Gregory Heytings , Eli Zaretskii , 59956@debbugs.gnu.org To: Augusto Stoffel , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 19:06:15 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 1p7KWl-000894-4M for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 19:06:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7KWa-0001yr-OJ; Mon, 19 Dec 2022 13:06: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 1p7KWZ-0001wf-CI for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 13:06: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 1p7KWY-0004lB-O8 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 13:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7KWY-0005c5-A0 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 13:06: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 18:06: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.167147310321563 (code B ref 59956); Mon, 19 Dec 2022 18:06:02 +0000 Original-Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 18:05:03 +0000 Original-Received: from localhost ([127.0.0.1]:39526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7KVb-0005bj-EH for submit@debbugs.gnu.org; Mon, 19 Dec 2022 13:05:03 -0500 Original-Received: from mail-pj1-f52.google.com ([209.85.216.52]:41750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7KVY-0005bH-Jf for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 13:05:01 -0500 Original-Received: by mail-pj1-f52.google.com with SMTP id n65-20020a17090a2cc700b0021bc5ef7a14so9669945pjd.0 for <59956@debbugs.gnu.org>; Mon, 19 Dec 2022 10:05:00 -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=KyQDhQQCs/Mir9jrSLUQdTdbJxCPwxur9e39hvQ3g+s=; b=Z5atr/4cU4ydjjzWvgrA7Lgpk4os6W1rtLuOAZzCD369sid9pAHKGxiz5B0wdS4l1T aK1xRaQbPtKCy8vh8ZAIHfRLF81XdKsBBGNrQJGUIQNANOvUiD1JDELcNyZb5S9rTmDQ PM0zhmas9V+otRCycijtF/OPztsfsRutlv1vEc7jx4DD9vBeCTdjmJMmZ/pFZqGNQrmq O9wYFKNVD12/myT4DC1vj6EgIW04LD5gZH/xLzGfa/R8t4+u6LL6v74/5z5bKWNhPA6Y 4Yp610dxxfWed40KpSpWKZ5rOVZva6w/90MTWDFEh9KFPXFGzxG350Wmjs9TuUppl1a5 mzXg== 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=KyQDhQQCs/Mir9jrSLUQdTdbJxCPwxur9e39hvQ3g+s=; b=DgXgLL/f25/Dl1FjJOn9W62WZnY4og53CtFxmFXLUCACOh3v+vkMwZghmO0wTEDlz8 L855h6Ml8fWWA/B3V5abr8JtcIDxpvXUgaSyPtIBTB9UQ8dNBGJF7JadGZsXeW4Q/fC4 L7knWx+iUI9kC4Pz1jAeaOiU+XXno8SYYdHDezyWjK1Uh52gduZY9YLcP4k86twtFcow 2Z0jffx6CT+PNlXZ7Ehu/lYyxgG9uuwTUQWs8iWzwDEz0mzILttyj+IAU0VbaFlkZpWC W1AbFa8NZ3cwI5V3MfD4bu2xO7KQ/Sz2KFlhx0oHdQ0hiRUTsF5ofYVmOhrZvnpapEck mubw== X-Gm-Message-State: AFqh2krOyM5tK8jNhAGWqKo6R0Te6D9eA4e1FeEjWefrYa10t6jg4wkz vgdi9DQ3Cg+0Z8x4RSF9f00= X-Google-Smtp-Source: AMrXdXuCxViKkLxq3vtEHbqDRkyJ7cE08YtFt01V6afphJaltlkF12d/xGxDglBGisCpbcsxu7J7AA== X-Received: by 2002:a17:902:e84c:b0:191:d98:7d7e with SMTP id t12-20020a170902e84c00b001910d987d7emr15327911plg.22.1671473094586; Mon, 19 Dec 2022 10:04:54 -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 l9-20020a170902d34900b00189fdadef9csm7491353plk.107.2022.12.19.10.04.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Dec 2022 10:04:54 -0800 (PST) Content-Language: en-US In-Reply-To: <87v8m7heh8.fsf@gmail.com> 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:251450 Archived-At: On 12/19/2022 2:31 AM, Augusto Stoffel wrote: > If $foo is "-u -v"`, your patch will make pcomplete see this as a single > argument, no? For Eshell at least, that's what it should do: ~ $ setq foo "-AlF ." -AlF . ~/src/emacs/build $ ls $foo /usr/bin/ls: invalid option -- ' ' Try '/usr/bin/ls --help' for more information. Variable expansions in Eshell work more like they do in Zsh, where they *aren't* split into multiple arguments on word boundaries. > 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. I think the best would be if code that invokes Pcomplete would tell Pcomplete the expanded forms of its arguments like it does now, but to additionally make sure that the Pcomplete function sees those arguments the way the actual command would. If Eshell provided a flattened list of strings to Pcomplete, then everything should Just Work, right? However, I'm not sure how to do that *and* be able to provide the un-stringified version so that Pcomplete functions for built-in Eshell commands can access those arguments in their original (but still expanded) forms. Can Eshell know ahead of time what form to provide its arguments in? Should it just provide both and let the Pcomplete function pick its poison?