From unknown Sat Aug 16 16:01:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#59956 <59956@debbugs.gnu.org> To: bug#59956 <59956@debbugs.gnu.org> Subject: Status: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Reply-To: bug#59956 <59956@debbugs.gnu.org> Date: Sat, 16 Aug 2025 23:01:22 +0000 retitle 59956 29.0.60: Failure when completing arguments in Eshell after va= riable interpolation reassign 59956 emacs submitter 59956 Jim Porter severity 59956 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 10 20:26:03 2022 Received: (at submit) by debbugs.gnu.org; 11 Dec 2022 01:26:03 +0000 Received: from localhost ([127.0.0.1]:45990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4B6Q-0002UE-P5 for submit@debbugs.gnu.org; Sat, 10 Dec 2022 20:26:02 -0500 Received: from lists.gnu.org ([209.51.188.17]:46348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4B6N-0002Tq-0u for submit@debbugs.gnu.org; Sat, 10 Dec 2022 20:26:00 -0500 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 1p4B6M-0003uX-SA for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2022 20:25:58 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4B6L-0003h3-D5 for bug-gnu-emacs@gnu.org; Sat, 10 Dec 2022 20:25:58 -0500 Received: by mail-pl1-x634.google.com with SMTP id p24so8659473plw.1 for ; Sat, 10 Dec 2022 17:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Ga6QaDzIfyUsJoN8X4GTq7eDQKvAtOSVVBsdlFYAtzY=; b=EhUOce4x7fUqx+YRcRCp3qygUc9fN94EWMbM/AfoBqZuWn/hQOzsS3H8ymuJul1gT8 80yoCZvGGy2ZmMhTfuRqViIteTfX4LVi4N/vmFiLL5VqJKY1JxrcM4Geu2LKnsyWUkbC nAe6tcUPvQ2KULepZ8Q7l+Hc3cT4s27tCW2VgL4HGaqTZ979wAGbNcQoUdEL265fSJam IR1uc9UFhrBsC1RgiKDfMRDK2Zed9v8675INiTbVZ6bcEBFhBPku5YupmMta9AVRN6WO vbjJLdXEHKZU84BcjjGF91D5KqK4hSGhO4kqqTUV89RfQOoMrHKWSZ8hrBEQc8p5ISXe bqog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Ga6QaDzIfyUsJoN8X4GTq7eDQKvAtOSVVBsdlFYAtzY=; b=2SO7C9d8tmRm3mqE8XweZbRnqAC7MJyatQCQThkWASBihAlpEBHjAFuTpyjrbVc6D2 ZtMpEEmKCTqFm7P6tbMoYQ6AXiFVK8ypRXdIKPnJEYNFQbhwlpw+0hge4v5dfJGcpUSe YwGG9yE4qWpfQarzgE0sq8nuler6kDNJl2SRTrd2nBErxbrJARBcywsw3lUg09C0pjMv oGXfz701G/7CF8jA+/OGhMYdjq5tn+XrW8nL3MD+3OfqQn8XwAr48C/7rOOjHg3drC8b zuuoq+DtTxEuztEFkKiJUDli/Ch1NNKmZMfaYrhCtYYz2mdduW1LWa/C7s9SaeEWrJ6K Dqyg== X-Gm-Message-State: ANoB5pkZSLbVcBULFOx1jS3ybybWcl+zguPT63o8xqDUvtgQ/GC7ABz1 isGpDIaJ9uFZp2jnpJvxaWUUx8Mcy4c= X-Google-Smtp-Source: AA0mqf5nRdXxyqGbnqTKicVxOuSGIq5ERlBSVPVDQs2FCXLieQEqHiTrDdRJSeuahNyaxQB/Nbmi+w== X-Received: by 2002:a17:90b:3591:b0:219:bf1a:7cbe with SMTP id mm17-20020a17090b359100b00219bf1a7cbemr11237344pjb.27.1670721955213; Sat, 10 Dec 2022 17:25:55 -0800 (PST) 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 mt15-20020a17090b230f00b002191a64b5d5sm3149537pjb.18.2022.12.10.17.25.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 10 Dec 2022 17:25:54 -0800 (PST) Message-ID: Date: Sat, 10 Dec 2022 17:25:53 -0800 MIME-Version: 1.0 X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: Jim Porter Subject: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=jporterbugs@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) X-Debbugs-CC: arstoffel@gmail.com Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the trailing space), and then hit TAB. The result is this error: pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) This is a regression from Emacs 28, and it looks like it's due to 'pcomplete-here-using-help' assuming that all the pcomplete args are strings. However, 'exec-path' is a list (and Eshell reports it this way to pcomplete), so the completion fails. I think all that's necessary is checking that the pcomplete args are strings in 'pcomplete-here-using-help', but I know next to nothing about pcomplete... From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 11 02:44:36 2022 Received: (at 59956) by debbugs.gnu.org; 11 Dec 2022 07:44:36 +0000 Received: from localhost ([127.0.0.1]:46177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4H0l-0006Oe-Ub for submit@debbugs.gnu.org; Sun, 11 Dec 2022 02:44:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4H0k-0006OY-2S for 59956@debbugs.gnu.org; Sun, 11 Dec 2022 02:44:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4H0c-0007Eh-DD; Sun, 11 Dec 2022 02:44:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nqlo+LRu4BfG+//3dSCRLXwXkmEW2swCpBrXP4yxw7M=; b=YsQ2OfnEDSpx QT1wPfyjjf2mMPiq3aJ4tZsZL/w+NJ2qf5DhkoHAVgZ3lzYta2SBbaxcPPcLFiTs/jRhohLvzT+rY dwVRS4w0qVmYtptajw3ifhYPR5caVLl4nIxKNPkqrPhwQZZRyZ1ImMdd9LcJXoCQRSlRD08D1j20J 99Pt92E3EtvtMvBlqp4AuD84wzr/I5bxtkvCvwbisjZt4OtHRwGwiKQV2qABrVi20PbDaA9iZNuPp PJ/BLpr76X/8piWdh8Rp8sqXyKfwLArdLTGWBkcVI6hodPmfvY9D4O9E4tYNzaOBhWJycs3s3tkR+ hfE7SqUszcS1VpXyVZ+NCw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4H0b-0003jx-RX; Sun, 11 Dec 2022 02:44:26 -0500 Date: Sun, 11 Dec 2022 09:44:24 +0200 Message-Id: <83iliiv0yv.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter , Stefan Monnier In-Reply-To: (message from Jim Porter on Sat, 10 Dec 2022 17:25:53 -0800) Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: arstoffel@gmail.com, 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: arstoffel@gmail.com > Date: Sat, 10 Dec 2022 17:25:53 -0800 > From: Jim Porter > > X-Debbugs-CC: arstoffel@gmail.com > > Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the > trailing space), and then hit TAB. The result is this error: > > pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) > > This is a regression from Emacs 28, and it looks like it's due to > 'pcomplete-here-using-help' assuming that all the pcomplete args are > strings. However, 'exec-path' is a list (and Eshell reports it this way > to pcomplete), so the completion fails. I think all that's necessary is > checking that the pcomplete args are strings in > 'pcomplete-here-using-help', but I know next to nothing about pcomplete... Adding Stefan, who should know more about pcomplete. Stefan, any suggestions? From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 11 03:56:30 2022 Received: (at 59956) by debbugs.gnu.org; 11 Dec 2022 08:56:30 +0000 Received: from localhost ([127.0.0.1]:46212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4I8L-0007Ge-SD for submit@debbugs.gnu.org; Sun, 11 Dec 2022 03:56:30 -0500 Received: from mail-ej1-f42.google.com ([209.85.218.42]:44800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4I8J-0007GY-1y for 59956@debbugs.gnu.org; Sun, 11 Dec 2022 03:56:28 -0500 Received: by mail-ej1-f42.google.com with SMTP id x22so21013720ejs.11 for <59956@debbugs.gnu.org>; Sun, 11 Dec 2022 00:56:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wD7//Y3mc2/PxBriZDEBRGFIBFxlmGfsXc3cY5CGb/M=; b=eoJWjK9vTC2FjCu91B5dhwBjL4K1i2+F4kk/2SuI1Dbf1z9zvSKzfu4ixLSCnyUIPg /V8nFowDyN/1vkUwYIJzeZaesbc7XdqiXF3vjqhIVsYutlCRsLdjNmqRCXWZSOpZkz4/ mk1oEzWzPtcQoyGi+kT0/8aNdH92Ky+GAl/XEilo57sdzjWP2Pera4b+oxQ6xQUsmAjR +jInN3S3F4TDJCIOO1XdiHroe9WQQh6q9C6WxV9MvGzitoLS2iSstCGyijovlgkjSn2J Q70ihI9Nb4imiarCNZJgXQ/LR1B29AiKrqoiEdprhRPJSAuqS8Gptloqjlz9hJ1UJCF1 7xPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wD7//Y3mc2/PxBriZDEBRGFIBFxlmGfsXc3cY5CGb/M=; b=tfCEK+yJoENucnysTx02tN1Cu9u4+F+i20f4IYDWiR/4YD8Fv4U5J/mOJKSscFbPG6 oWarnVuhiLyO5wPen1j3VeR6+NVRWyvUYzVdzU1t5zgIv+8Q5ta2umYPU1qVKEXo/r0r LXmDAjiWaDs+yDwVi5MkNbvWIyCv1Cb8jTOGLNIWn/Ss8TORKk2kuAXtbM3PsEc+N8Rj QhQ4QmJ994WO2XHiNhbzBKcL9MtaadiToopF2Ck83rl6wKYoQyXJ4j6BVcWXkCSgZBF5 /QVBiPiRIehBmOB9ltrbygMCbLCKMpGwy/ppcSNBl8aRQFvDCaiBZXqdKef3GUd4JpxO YA5w== X-Gm-Message-State: ANoB5pk61MW1porKncbsZVi7cKnnVbgNadYbp9dzIgqDaz1TZ9lejVxY HZdnzcwLlRRwuwCGFbELqZi2mvcoc2Zh6w== X-Google-Smtp-Source: AA0mqf7WCgs5yMkif1VDCszahvPxR0RyawDJhZNhlYvsAzyz9p5OhkHGFdJ0pawFxuHgOBcHMz3Waw== X-Received: by 2002:a17:906:3716:b0:7c0:bbab:22e5 with SMTP id d22-20020a170906371600b007c0bbab22e5mr9767002ejc.16.1670748980742; Sun, 11 Dec 2022 00:56:20 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::a4bf]) by smtp.gmail.com with ESMTPSA id q8-20020a17090676c800b007b790c18264sm1854307ejn.159.2022.12.11.00.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Dec 2022 00:56:19 -0800 (PST) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <83iliiv0yv.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 11 Dec 2022 09:44:24 +0200") References: <83iliiv0yv.fsf@gnu.org> Date: Sun, 11 Dec 2022 09:56:18 +0100 Message-ID: <87mt7u48ul.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, 11 Dec 2022 at 09:44, Eli Zaretskii wrote: >> Cc: arstoffel@gmail.com >> Date: Sat, 10 Dec 2022 17:25:53 -0800 >> From: Jim Porter >> >> X-Debbugs-CC: arstoffel@gmail.com >> >> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the >> trailing space), and then hit TAB. The result is this error: >> >> pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) >> >> This is a regression from Emacs 28, and it looks like it's due to >> 'pcomplete-here-using-help' assuming that all the pcomplete args are >> strings. However, 'exec-path' is a list (and Eshell reports it this way >> to pcomplete), so the completion fails. I think all that's necessary is >> checking that the pcomplete args are strings in >> 'pcomplete-here-using-help', but I know next to nothing about pcomplete... > > Adding Stefan, who should know more about pcomplete. > > Stefan, any suggestions? For the record, this problem afflicts just about every pcomplete rule (except probably those meant specifically for eshell). I just tried `cvs $echo-path TAB` and I get the same error. The issue here is what eshell returns via (pcomplete-arg ...) etc. Currently it can be a list. How about changing it to the string "$echo-path", with the list sneaked in as a text property? From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 11 10:27:55 2022 Received: (at 59956) by debbugs.gnu.org; 11 Dec 2022 15:27:55 +0000 Received: from localhost ([127.0.0.1]:46622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4OF9-0005Ys-4J for submit@debbugs.gnu.org; Sun, 11 Dec 2022 10:27:55 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4OF6-0005Yk-Tl for 59956@debbugs.gnu.org; Sun, 11 Dec 2022 10:27:53 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 432CF44076E; Sun, 11 Dec 2022 10:27:47 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 84A04440760; Sun, 11 Dec 2022 10:27:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1670772465; bh=O5edkEN3ozoS1sUPg+/cHE6J5q8iQ1HJ4xKA/L0Fp3I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RbCsgtOX4WlLS27Z8lqMacN93EN92eckKbKBFDx9aUxAr7SCsiB7qMI+Gq5Q4IT2U wZ4vKxEf5HXaHoppI9mw+43/Y8HDbYFsoC1eGMe3lkC4rEeZUSQceMpcgCiOO5GaNB N8KhOq+aqWhN73wD3L+tRmRx58/coIQ4rrFaWDyzn3HCZR08yF+h4dwaGqkbO5PQYB PmXbUD5XYN7e92y0NLG9bK42w9ZQqPakB9jM0GbA9f05oB8h0HkyxS1GqMF0Oiykxf 4KRwXNIXf3i0lEHvtbqxJxSfdiW+mRGQ7sJPrZUMyi5SkIbfbOoQaJ3MClynfBKmIg hJO6t7RXCsUCA== Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E4CB31201FF; Sun, 11 Dec 2022 10:27:44 -0500 (EST) From: Stefan Monnier To: "John Wiegley" Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <87mt7u48ul.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 11 Dec 2022 09:56:18 +0100") Message-ID: References: <83iliiv0yv.fsf@gnu.org> <87mt7u48ul.fsf@gmail.com> Date: Sun, 11 Dec 2022 10:27:42 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.375 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , Augusto Stoffel , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi John, As the original designer of both Eshell and Pcomplete, what's your opinion on the below: >>> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the >>> trailing space), and then hit TAB. The result is this error: >>> >>> pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) >>> >>> This is a regression from Emacs 28, and it looks like it's due to >>> 'pcomplete-here-using-help' assuming that all the pcomplete args are >>> strings. However, 'exec-path' is a list (and Eshell reports it this way >>> to pcomplete), so the completion fails. I think all that's necessary is >>> checking that the pcomplete args are strings in >>> 'pcomplete-here-using-help', but I know next to nothing about pcomplete... >> >> Adding Stefan, who should know more about pcomplete. >> Stefan, any suggestions? > > For the record, this problem afflicts just about every pcomplete rule > (except probably those meant specifically for eshell). I just tried > `cvs $echo-path TAB` and I get the same error. Indeed, it seems to be a pervasive problem. > The issue here is what eshell returns via (pcomplete-arg ...) etc. > Currently it can be a list. How about changing it to the string > "$echo-path", with the list sneaked in as a text property? >From the point of view of Pcomplete, `pcomplete-arg` should indeed always return a string, I think. But should it be the string as it stands in the buffer or the string *represented* by what's in the buffer (i.e. after $ expansion and such)? Should `pcomplete-arg` return nil in a case like `echo $nil`? For "normal" shells, this is not an issue since they don't really manipulate anything else than strings (or so we can pretend), but obviously things aren't that simple for Eshell. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 17:21:09 2022 Received: (at 59956) by debbugs.gnu.org; 12 Dec 2022 22:21:09 +0000 Received: from localhost ([127.0.0.1]:55768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rAb-0004wP-70 for submit@debbugs.gnu.org; Mon, 12 Dec 2022 17:21:09 -0500 Received: from heytings.org ([95.142.160.155]:55460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rAY-0004wJ-Je for 59956@debbugs.gnu.org; Mon, 12 Dec 2022 17:21:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1670883664; bh=vYJ8BlNI4URvEB+rk4+MyLwH8A9kkXvPPNy4TuWmASM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=B70f7zaOrXJWtMXtJVI+4YDNGF/qYtrEGIS5qXgummsyQ6+ib4zEfGmyJwWT2APVu 55MB/w7Vzt1G4zKe6esh0tUtV0OEGO2x+57G5QQQvYqUp7xbIunHlpFn+iaPrI2eMP fnp/VC+abSx5JM03pmNHLPbkSpvK2SSxY7rzw+8CPs9hObCRIqMFX1sI0lgdHaeFZ4 yeqvwCTQgZZ5FuEapEspJb0P5NCY0MIJdsCB+qlYI7AuGjg2IQIl38JLg0FGXAPtBz A76AVDHVuF07q3ODUs4Czv0yepdZEDQHQxl0XuLu5xFuvUpvNRdyV7R1P4k3JGv86K MRJRP/2uU9XsQ== Date: Mon, 12 Dec 2022 22:21:03 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <83iliiv0yv.fsf@gnu.org> Message-ID: References: <83iliiv0yv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="uRCW0xUpGb" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , arstoffel@gmail.com, Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --uRCW0xUpGb Content-Type: text/plain; format=flowed; charset=us-ascii >> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note the >> trailing space), and then hit TAB. The result is this error: >> >> pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) >> >> This is a regression from Emacs 28, and it looks like it's due to >> 'pcomplete-here-using-help' assuming that all the pcomplete args are >> strings. However, 'exec-path' is a list (and Eshell reports it this way >> to pcomplete), so the completion fails. I think all that's necessary is >> checking that the pcomplete args are strings in >> 'pcomplete-here-using-help', but I know next to nothing about >> pcomplete... > > Adding Stefan, who should know more about pcomplete. > > Stefan, any suggestions? > I'm still not Stefan, but this bug is fixed by the attached patch. --uRCW0xUpGb Content-Type: text/x-diff; name=Check-that-arguments-are-strings-in-pcomplete-here-u.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Check-that-arguments-are-strings-in-pcomplete-here-u.patch RnJvbSA2MDQxNmQzOWNkYTNlYmYzMzZiZGI3NzQ4N2QzYjdkOGQ0MjlmMWI2 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBNb24sIDEyIERl YyAyMDIyIDIyOjE2OjE4ICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIENoZWNr IHRoYXQgYXJndW1lbnRzIGFyZSBzdHJpbmdzIGluIHBjb21wbGV0ZS1oZXJl LXVzaW5nLWhlbHANCg0KKiBsaXNwL3Bjb21wbGV0ZS5lbCAocGNvbXBsZXRl LWhlcmUtdXNpbmctaGVscCk6IENoZWNrIHRoYXQNCnBjb21wbGV0ZS1hcmdz IGFyZSBzdHJpbmdzIGJlZm9yZSBhcHBseWluZyBzdHJpbmcgb3BlcmF0aW9u cyBvbg0KdGhlbS4gIEZpeGVzIGJ1ZyM1OTk1NiBhbmQgYnVnIzYwMDIxLg0K LS0tDQogbGlzcC9wY29tcGxldGUuZWwgfCAxMiArKysrKysrKystLS0NCiAx IGZpbGUgY2hhbmdlZCwgOSBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygt KQ0KDQpkaWZmIC0tZ2l0IGEvbGlzcC9wY29tcGxldGUuZWwgYi9saXNwL3Bj b21wbGV0ZS5lbA0KaW5kZXggNGUzYTg4YmJkYTguLmM2M2M0OTBiY2FhIDEw MDY0NA0KLS0tIGEvbGlzcC9wY29tcGxldGUuZWwNCisrKyBiL2xpc3AvcGNv bXBsZXRlLmVsDQpAQCAtMTQ0OSwxMiArMTQ0OSwxOCBAQCBwY29tcGxldGUt aGVyZS11c2luZy1oZWxwDQogVGhlIHN3aXRjaGVzIGFyZSBvYnRhaW5lZCBi eSBjYWxsaW5nIGBwY29tcGxldGUtZnJvbS1oZWxwJyB3aXRoDQogQ09NTUFO RCBhbmQgQVJHUyBhcyBhcmd1bWVudHMuIg0KICAgKHdoaWxlIChjb25kDQot ICAgICAgICAgICgoc3RyaW5nPSAiLS0iIChwY29tcGxldGUtYXJnIDEpKQ0K KyAgICAgICAgICAoKGxldCAoKGFyZyAocGNvbXBsZXRlLWFyZyAxKSkpDQor ICAgICAgICAgICAgIChpZiAoc3RyaW5ncCBhcmcpDQorICAgICAgICAgICAg ICAgICAoc3RyaW5nPSAiLS0iIGFyZykpKQ0KICAgICAgICAgICAgKHdoaWxl IChwY29tcGxldGUtaGVyZSAocGNvbXBsZXRlLWVudHJpZXMpKSkpDQotICAg ICAgICAgICgocGNvbXBsZXRlLW1hdGNoICJcXGAtLVtePV0rPVxcKC4qXFwp IiAwKQ0KKyAgICAgICAgICAoKGxldCAoKGFyZyAocGNvbXBsZXRlLWFyZyAw KSkpDQorICAgICAgICAgICAgIChpZiAoc3RyaW5ncCBhcmcpDQorICAgICAg ICAgICAgICAgICAocGNvbXBsZXRlLW1hdGNoICJcXGAtLVtePV0rPVxcKC4q XFwpIiAwKSkpDQogICAgICAgICAgICAocGNvbXBsZXRlLWhlcmUgKHBjb21w bGV0ZS1lbnRyaWVzKQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIChw Y29tcGxldGUtbWF0Y2gtc3RyaW5nIDEgMCkpKQ0KLSAgICAgICAgICAoKHN0 cmluZy1wcmVmaXgtcCAiLSIgKHBjb21wbGV0ZS1hcmcgMCkpDQorICAgICAg ICAgICgobGV0ICgoYXJnIChwY29tcGxldGUtYXJnIDApKSkNCisgICAgICAg ICAgICAgKGlmIChzdHJpbmdwIGFyZykNCisgICAgICAgICAgICAgICAgIChz dHJpbmctcHJlZml4LXAgIi0iIGFyZykpKQ0KICAgICAgICAgICAgKHBjb21w bGV0ZS1oZXJlIChhcHBseSAjJ3Bjb21wbGV0ZS1mcm9tLWhlbHAgY29tbWFu ZCBhcmdzKSkpDQogICAgICAgICAgICh0IChwY29tcGxldGUtaGVyZSogKHBj b21wbGV0ZS1lbnRyaWVzKSkpKSkpDQogDQotLSANCjIuMzUuMQ0KDQo= --uRCW0xUpGb-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 17:37:34 2022 Received: (at 59956) by debbugs.gnu.org; 12 Dec 2022 22:37:34 +0000 Received: from localhost ([127.0.0.1]:55858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rQT-00059j-Ni for submit@debbugs.gnu.org; Mon, 12 Dec 2022 17:37:33 -0500 Received: from mail-ej1-f46.google.com ([209.85.218.46]:34513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4rQR-00059Z-J6 for 59956@debbugs.gnu.org; Mon, 12 Dec 2022 17:37:31 -0500 Received: by mail-ej1-f46.google.com with SMTP id t17so32062728eju.1 for <59956@debbugs.gnu.org>; Mon, 12 Dec 2022 14:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ptx7cY9M02mdbiAxONk2nw1YP7TksZfQTnNMKaH2PEk=; b=lhEyJyLkSolg+MBLxfBLuRguAv3tx8+sAngRzZvxWWyHwm9GuiDAkRFhOyd+4DIHu8 YdCI7UlXPaiKgdygxrgEKx2XpLP0PKW2Fh9WUDUsGeASMj6ZGipYJMvrccJqP8x/QF+N WOiXSRkgGC2ZUQJG6KZqX3obuwfvuCTL1+r9LObORYlT7ev1TcdbK50NNHKaV1x54KQN Dgs5mCdao5odc5gna20AneiFFoLpo9K8JL9mWmNWApob79/5exyOQdSOW5uG1EMmHina BA+4rCAzJAGzDYQxZ/Iraybr8BVTKbX0SuSyitm8bNI6FbhECM5QIZLRn19915LOUEsb zA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ptx7cY9M02mdbiAxONk2nw1YP7TksZfQTnNMKaH2PEk=; b=kIl44X8LwB5s8QleYw4XQWvTWMpotnurp10Mgg5eT0ewYDZzYanmGun/3LKlVrB9us Tx8t7J7jDWtiJbI85J010sebetCCgFaYya+BFixTmdwMFh3jUbD2c0uj5fbazDy5HOS1 3MY24Qct1HG7Fx5j7VB0XqJOqScE7F7F8qUDFVFbU5WKOSD2DPYrfWMplW3CcUeBF8ri xtbtwO1LKk8M9owR70dhgCcOa97VtNWurX1O4YUmHpP5WH6GBLzIaftNTJxoGwBKb73j UtOmXlx1rMpi4VylDvUcwhDZkMI4cfECqFXQWLPy7/TZypHFapzgB+jkXMZMmAP98Lhb oWWw== X-Gm-Message-State: ANoB5pmu1igK7EIVeNycdHn8piAI6OYt3dJNcqAPFCGZCEWEHlDAKsjq 8JSXuc/5tjVzorfSGr+spM8yPTbZBL5T6w== X-Google-Smtp-Source: AA0mqf5/zDUbpzXMmg5+6vqmH85GjB8BPWbFZWRXJwKw8KHk11IPzlW1X4Rly/nKdvdYRKcGgpVumQ== X-Received: by 2002:a17:907:c295:b0:78d:f455:c398 with SMTP id tk21-20020a170907c29500b0078df455c398mr3555826ejc.62.1670884645416; Mon, 12 Dec 2022 14:37:25 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::911f]) by smtp.gmail.com with ESMTPSA id ku3-20020a170907788300b007c18598a2f3sm528960ejc.196.2022.12.12.14.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 14:37:24 -0800 (PST) From: Augusto Stoffel To: Gregory Heytings Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: (Gregory Heytings's message of "Mon, 12 Dec 2022 22:21:03 +0000") References: <83iliiv0yv.fsf@gnu.org> Date: Mon, 12 Dec 2022 23:37:24 +0100 Message-ID: <87h6y0nt97.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, 12 Dec 2022 at 22:21, Gregory Heytings wrote: >>> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note >>> the trailing space), and then hit TAB. The result is this error: >>> >>> pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) >>> >>> This is a regression from Emacs 28, and it looks like it's due to >>> 'pcomplete-here-using-help' assuming that all the pcomplete args >>> are strings. However, 'exec-path' is a list (and Eshell reports it >>> this way to pcomplete), so the completion fails. I think all that's >>> necessary is checking that the pcomplete args are strings in >>> 'pcomplete-here-using-help', but I know next to nothing about >>> pcomplete... >> >> Adding Stefan, who should know more about pcomplete. >> >> Stefan, any suggestions? >> > > I'm still not Stefan, but this bug is fixed by the attached patch. This is not a fix to the problem, in my opinion. Just take any other command with a pcomplete rule, say "cvs $exec-path SPC TAB" and you will see the same problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 18:27:35 2022 Received: (at 59956) by debbugs.gnu.org; 12 Dec 2022 23:27:35 +0000 Received: from localhost ([127.0.0.1]:56188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4sCs-0005uV-VC for submit@debbugs.gnu.org; Mon, 12 Dec 2022 18:27:35 -0500 Received: from heytings.org ([95.142.160.155]:55608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4sCr-0005uP-9e for 59956@debbugs.gnu.org; Mon, 12 Dec 2022 18:27:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1670887651; bh=22k0vk5BlimCwZCq8Fo2ka6dMrqdUcJQp9k5gRvCOpc=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=oOVKbobYSfkuN4HfrpV30OMeFz845pszfNbTSH8zWpfII/u7AWub6AGFWWaHssXZt n+87+UHUQ2wGYsFiJN+73RhMPVAgfOWVK/L7nusTILJkMUVcx3XLLRYohPtN+0AsXh sqYNwEy4VKX9/ntNKUFF4KHxJLt9m5bkjqENEvd8H256/ksuhXX7TDhLf7M1Fx5JYm SnejOuLW3mHJlJcgI0GVCg08xTstJ4yZBPE/cpdnpT0q/6FJ0r2GmYxLdItm6ELdxp nuddjQeRgVeGa7Dww/bXr0nhlwE3/QgPDkz2WGwLRPURxzDczop0c6tzq0faxnvp6n wGnozCFwgLbEA== Date: Mon, 12 Dec 2022 23:27:31 +0000 From: Gregory Heytings To: Augusto Stoffel Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <87h6y0nt97.fsf@gmail.com> Message-ID: References: <83iliiv0yv.fsf@gnu.org> <87h6y0nt97.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>> Starting from "emacs -Q -f -eshell", type "echo $exec-path " (note >>>> the trailing space), and then hit TAB. The result is this error: >>>> >>>> pcomplete-match: Wrong type argument: stringp, ("/usr/bin" ...) >>>> >>>> This is a regression from Emacs 28, and it looks like it's due to >>>> 'pcomplete-here-using-help' assuming that all the pcomplete args are >>>> strings. However, 'exec-path' is a list (and Eshell reports it this >>>> way to pcomplete), so the completion fails. I think all that's >>>> necessary is checking that the pcomplete args are strings in >>>> 'pcomplete-here-using-help', but I know next to nothing about >>>> pcomplete... >>> >>> Adding Stefan, who should know more about pcomplete. >>> >>> Stefan, any suggestions? >> >> I'm still not Stefan, but this bug is fixed by the attached patch. > > This is not a fix to the problem, in my opinion. Just take any other > command with a pcomplete rule, say "cvs $exec-path SPC TAB" and you will > see the same problem. > Agreed, it's not a proper fix for that bug. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 01:09:21 2022 Received: (at 59956) by debbugs.gnu.org; 16 Dec 2022 06:09:21 +0000 Received: from localhost ([127.0.0.1]:47297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p63uL-0004Aw-JO for submit@debbugs.gnu.org; Fri, 16 Dec 2022 01:09:21 -0500 Received: from mail-pg1-f174.google.com ([209.85.215.174]:38700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p63uH-0004Ao-GF for 59956@debbugs.gnu.org; Fri, 16 Dec 2022 01:09:20 -0500 Received: by mail-pg1-f174.google.com with SMTP id w37so1113855pga.5 for <59956@debbugs.gnu.org>; Thu, 15 Dec 2022 22:09:17 -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:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=CsSOBNSP41rYN446/ynbYssgHUN7Dqh2odwcCoetAvw=; b=Zdb6izBed1VzI9DdQS3oBIQAbATmzY+Z4oEVvThYkAJtv+2SHjc2UfLKPnqAqseg0O A2TWlrNditqNjQQ5pcBWiCgBuNvp7va05XR08D27DhtttVHGa4ZTtaZWFGH+pfuxAcuq 1/1DLkugfjOdX+dyWhVGKykgCcgSd1dBtTM0z4Mw+yrjppBAgOpxYAtO1jv62K2v//WC +GMLHqz+pzG+NU25xC3DS/aZkeLyG+az2F9Nik2Bv4vqrpIHyXIpT274mhuqmZzzsnh6 AxOWGC8cqbfzYXjZBOS/0oQieRyBK6YQ5kP0UjUA6KBK5aoMFHZoY2tPacgmcJioIswM 20eg== 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:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CsSOBNSP41rYN446/ynbYssgHUN7Dqh2odwcCoetAvw=; b=CtXPzaUjloEW4cAsUnEWNt0A2+0wg6TeRFFKuK+9uKKwozK+/K17H5mva5LfI9JWtk ZteS0dHpknVe9GIDwhoTsGvuVa++oGGTQIGS+3ZmM/NUviZJKz54b+LONSNz9OidAkEB z6stt1wDnRr7wqNpt/7lMwet7uxFGaha+iR8QsC96zGB1WlJJG99k6BmCveE9SrFnmlQ kVE2eFkljbvCQXUAJ65fslz2eur1f1Soudsy+bvFrDjtn79+KWV2uFYrXd9p8Z9Uzrno OPze52flCrqtuNH38gqCHfYDydH1V3ILkK3hX9MDkqucFoGPmq7Z0atgjTs3og/lXisJ itIA== X-Gm-Message-State: ANoB5pk3CKt/GUIVAcJvQpvbd+apB3BLRQbGao4kIElDRFoqeFuutQbO NkUs3iTcUFRMdgamkUPuVGM= X-Google-Smtp-Source: AA0mqf789pKINQQoJ9V4jzAmCXlUZh80Yf79u2UR9/3/UzjpH5x4idWY86eqv0evSBWJnobYOfzczQ== X-Received: by 2002:a05:6a00:2bb:b0:57a:9b14:69b7 with SMTP id q27-20020a056a0002bb00b0057a9b1469b7mr14245206pfs.0.1671170951560; Thu, 15 Dec 2022 22:09:11 -0800 (PST) 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 i73-20020a62874c000000b0056bc5ad4862sm622804pfe.28.2022.12.15.22.09.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Dec 2022 22:09:10 -0800 (PST) Message-ID: <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> Date: Thu, 15 Dec 2022 22:09:10 -0800 MIME-Version: 1.0 Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation To: Gregory Heytings , Eli Zaretskii References: <83iliiv0yv.fsf@gnu.org> Content-Language: en-US From: Jim Porter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: arstoffel@gmail.com, Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/12/2022 2:21 PM, Gregory Heytings wrote: > I'm still not Stefan, but this bug is fixed by the attached patch. Thanks. This is pretty close to what I was thinking (I tried almost the exact same patch locally, but wasn't sure if there was a better way). Personally, I think something like your patch would probably be the safest bet for the 29 branch. Still, like Stefan and Augusto mentioned, there's probably a larger issue here: should Eshell be allowed to feed Pcomplete non-strings? Since Pcomplete was written for Eshell initially, there's some basis for why it *might* support non-string values, but actually requiring that is an awful lot to ask of every programmer who ever wants to write a pcomplete function. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 06:20:38 2022 Received: (at 59956) by debbugs.gnu.org; 16 Dec 2022 11:20:39 +0000 Received: from localhost ([127.0.0.1]:48673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p68la-0007Zl-Iy for submit@debbugs.gnu.org; Fri, 16 Dec 2022 06:20:38 -0500 Received: from mail-ej1-f53.google.com ([209.85.218.53]:34504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p68lX-0007Zb-19 for 59956@debbugs.gnu.org; Fri, 16 Dec 2022 06:20:36 -0500 Received: by mail-ej1-f53.google.com with SMTP id t17so5452827eju.1 for <59956@debbugs.gnu.org>; Fri, 16 Dec 2022 03:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jQi7nuzq1NNPRumNxeUK95Phl63+/xdEl2cpbTC89Zs=; b=B5SxuttL+RwWXLjM3KoTWHnfG/ESax9g09vkime9msWr3HX5VhFqnilIL+i26W1g2v q1EVaQsYAPOuwqtWDtVm4g7wZXKhEULC3iIB6TRoM8rUp5jcJnDAh3PfhyVwdxlOYOch oCmZypYeUkCfRQVF9FnvTnahkNQ7hNj2mXvr9e5jXJCzoek2MvW/owC4AtYUAKRq2Lv6 pFiV/gGyxm3P9ezOrU9OpUBkPsHvnVwlSasT+/r6U2vxK18ISGaLdEGZnDOsCpukUJEF vW425l7wloxLjto4MEnmmVbTYgGKoywDyamDVZNKW6dZS15nAWLTPXGhh3wmStcKTjU9 VpUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jQi7nuzq1NNPRumNxeUK95Phl63+/xdEl2cpbTC89Zs=; b=RODIewDaQLjFnXOxK65H6g447TuHGr2ZNS1/J5HiIaJjrQuvn17hMGR4aZlZQPUHGw 8+tuVN61abIl/lJgnY13WbtKtt561ImdkWKSwiUB/iq/ZjHczQEFIFmFGJ5Y0NkaeAmN eEGrWuFoCJjGRccLBcRGKykMwIoO80FD9n60xPdx35d3q2tJmY+SRMvLwrun1pwhhheD CYLOtU/nIzXHrYoErD04fkzlu6HbRqpMoYMuZPK31hYekXO2hbMUNM+iWcUvLAGQAiIR abBv44uphKAsg0uQ46G+LMEuv+VLdAQhcqphXmCVIxYSifpEkzyawnYEQG+7XTcHSsDg u03Q== X-Gm-Message-State: ANoB5pnN/4BbjurS8Zks8LgqYRxuSbqACg0spF9+ekWPtB3icdDGhXDV fXKJs+pMMEEfCwzkmFGiVkj1mokn5scyTg== X-Google-Smtp-Source: AA0mqf68Q5HvNOmyW3QxbBbGjQq268rkhQVPGBq00bORUsdULcj0XaDaFzlzILGV1YHvGVXm0Y5HmQ== X-Received: by 2002:a17:907:2a02:b0:7c1:10b8:e6a4 with SMTP id fd2-20020a1709072a0200b007c110b8e6a4mr22154420ejc.19.1671189628596; Fri, 16 Dec 2022 03:20:28 -0800 (PST) Received: from ars3 (ip5f5aeede.dynamic.kabel-deutschland.de. [95.90.238.222]) by smtp.gmail.com with ESMTPSA id sa2-20020a170906eda200b0074134543f82sm747144ejb.90.2022.12.16.03.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 03:20:27 -0800 (PST) From: Augusto Stoffel To: Gregory Heytings Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: (Gregory Heytings's message of "Mon, 12 Dec 2022 23:27:31 +0000") References: <83iliiv0yv.fsf@gnu.org> <87h6y0nt97.fsf@gmail.com> Date: Fri, 16 Dec 2022 12:20:26 +0100 Message-ID: <87h6xvlhmt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , Stefan Monnier , 59956@debbugs.gnu.org, Daniel Mendler X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Mon, 12 Dec 2022 at 23:27, Gregory Heytings wrote: > Agreed, it's not a proper fix for that bug. There are only 6 pcomplete/eshell/* functions in my Emacs. It doesn't look like the proper fix, which is to adjust eshell so that the 22-year-old docstring of `pcomplete-match' is not lying anymore, is a lot of work. But I'm not an eshell user and don't know its internals at all. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 09:13:24 2022 Received: (at 59956) by debbugs.gnu.org; 16 Dec 2022 14:13:24 +0000 Received: from localhost ([127.0.0.1]:49583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6BSl-00064J-TF for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:13:24 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6BSg-000647-I1 for 59956@debbugs.gnu.org; Fri, 16 Dec 2022 09:13:22 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CE0391002B1; Fri, 16 Dec 2022 09:13:12 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4D32D10011C; Fri, 16 Dec 2022 09:13:11 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671199991; bh=OmiwEKsxz/I/SbqG3XMPzZpePL0+mAvByfj+8qQLF/A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kNugJiROzx0ygG91Lcda+emeIkKCuc6F4Mr4ZblONgrJMClEKllxNtZswzrpmtoxl z92DAtN1S5TK11ft+tQlt98vW05isrDQVmRQoNAY2ubAVdnF5rhNTuDQD6DtiLnWO6 ihvNwDqd6kyHKqi2GpkU/UOXaXP5jq8qj7t4s4FWxQ1A2EaYOzEs3pTeAPDSsLPPC3 Z/Fz1W7jTdqlRdDLTRozE/0HTjQFMzkwpa4fl0esNh7ZWigxq6QblnV9V1KCFSC8wZ rjJPnbdEeQvbKXV4/l2rMhOZi2jHwFVyLlmpYBXt+lsTZeqY/E915JiQGrYALxGwJS WssUyL2Vf8G6A== Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 16263120F3D; Fri, 16 Dec 2022 09:13:11 -0500 (EST) From: Stefan Monnier To: Jim Porter Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> (Jim Porter's message of "Thu, 15 Dec 2022 22:09:10 -0800") Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> Date: Fri, 16 Dec 2022 09:13:09 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.405 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: John Wiegley , Gregory Heytings , arstoffel@gmail.com, Eli Zaretskii , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Still, like Stefan and Augusto mentioned, there's probably a larger issue > here: should Eshell be allowed to feed Pcomplete non-strings? Since > Pcomplete was written for Eshell initially, there's some basis for why it > *might* support non-string values, but actually requiring that is an awful > lot to ask of every programmer who ever wants to write a pcomplete function. A "general" solution might be the one below, tho it looks more like a general workaround, I think. John? Stefan diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 4e3a88bbda8..6a4d754b8c0 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -646,12 +646,14 @@ pcomplete-arg The OFFSET argument is added to/taken away from the index that will be used. This is really only useful with `first' and `last', for accessing absolute argument positions." - (nth (+ (pcase index - ('first 0) - ('last pcomplete-last) - (_ (- pcomplete-index (or index 0)))) - (or offset 0)) - pcomplete-args)) + (let ((arg (nth (+ (pcase index + ('first 0) + ('last pcomplete-last) + (_ (- pcomplete-index (or index 0)))) + (or offset 0)) + pcomplete-args))) + (when arg + (if (stringp arg) arg (format "%S" arg))))) (defun pcomplete-begin (&optional index offset) "Return the beginning position of the INDEXth argument. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 09:28:48 2022 Received: (at 59956) by debbugs.gnu.org; 16 Dec 2022 14:28:48 +0000 Received: from localhost ([127.0.0.1]:49667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Bhf-0006Eo-TP for submit@debbugs.gnu.org; Fri, 16 Dec 2022 09:28:48 -0500 Received: from heytings.org ([95.142.160.155]:32842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Bhc-0006Ei-2j for 59956@debbugs.gnu.org; Fri, 16 Dec 2022 09:28:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1671200922; bh=csn0mxC6I3ndw6d7ATThjfwowWAQ9JP7/1A3jwSLs3U=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=sEVVYsWEQDYBeh6uTyN7+SgWAofxeAhyi1fnLQAw9HvPwLQCEq7UR0YbolfOJXUdn Yb89QdiGDhZxd0QpTy6h7gjsxT29+bGL+4c2nVG5zA8W/vnRJtCH4C59N1oH3UMfhk dGQLF8u15juU2QYFhX7fKJ2yYDrlXO2WENNui3rQJVMDinbKUvE49xj6NA9iRz4Mcb 21sYF2BfxZxY2cGcPgioDBiN/2CINMdONgE7sp4mlviJP/yFWKLsYG7bDYbJB9gEeL QOOQYOJT3QSYUgvkr4J2HrRh1WpnBcpXvTFXxItI96KK0GvFIJHx8cUswZ6Vg+5+pE JHAeNYSqP+WeQ== Date: Fri, 16 Dec 2022 14:28:42 +0000 From: Gregory Heytings To: Stefan Monnier Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: Message-ID: <07bcf6a532d0428b9f53@heytings.org> References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > A "general" solution might be the one below > Why not (format "%s" (nth (+ (pcase ...))))? > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 18 19:54:56 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 00:54:57 +0000 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 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 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) 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== 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) From: Stefan Monnier To: Gregory Heytings Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <07bcf6a532d0428b9f53@heytings.org> (Gregory Heytings's message of "Fri, 16 Dec 2022 14:28:42 +0000") Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> Date: Sun, 18 Dec 2022 19:54:44 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.342 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 18 20:19:37 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 01:19:37 +0000 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 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== Date: Mon, 19 Dec 2022 01:19:32 +0000 From: Gregory Heytings To: Stefan Monnier Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: 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 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> 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". From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 18 21:15:57 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 02:15:57 +0000 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 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 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) 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) Message-ID: Date: Sun, 18 Dec 2022 18:15:48 -0800 MIME-Version: 1.0 Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Content-Language: en-US To: Gregory Heytings , Stefan Monnier References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> From: Jim Porter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: John Wiegley , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 18 22:07:23 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 03:07:23 +0000 Received: from localhost ([127.0.0.1]:37416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p76Us-0004il-Sk for submit@debbugs.gnu.org; Sun, 18 Dec 2022 22:07:23 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p76Uq-0004if-MI for 59956@debbugs.gnu.org; Sun, 18 Dec 2022 22:07:21 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 43918100B14; Sun, 18 Dec 2022 22:07:15 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C1AF6100904; Sun, 18 Dec 2022 22:07:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671419233; bh=RbetN+KqRAbZCgR7rR3A6QLBEX8IGbAXTuwj3MDHcsM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IsR/U77KICBC1SLWnAFRK5POLBTf4V7YcfCQYh4zWLLuVdWx8hyqUBkQHlG2CLe8h 42o821N82OCNMImGtKopmhu4iuAfciLDvyPQwqfcXpxN1hdfHGUZuKOfmWS+kQ0RFE CpW9ABNFU39Kw86b2IUp99eVw16TSou9JXbbyPCxg3y9ukQokHCwGUYUfgaqMyUweo Qq6Y0YtLFhcbBuLOeWMCFMl1IRkjd0g3GMYeG7dCiygOdelElg3HjmzStJcTXqQKXg y0G8VEHgb+w7BODRvM4ZcPebXS32aKXgo8w2JOl/JmTltezeRKp1TdRZVqkTVtsVLP F7EB3UM8UOD9A== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8AC09120F47; Sun, 18 Dec 2022 22:07:13 -0500 (EST) From: Stefan Monnier To: Gregory Heytings Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: (Gregory Heytings's message of "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> Date: Sun, 18 Dec 2022 22:07:11 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.394 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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". Sounds like just another way to work around the problem. I think the only "real" fix is to change the API so the callers can say what kind of data they're looking for. The more I think about it, the more my workaround sounds appealing. My main remaining question is whether there exist code out there that relies on the current behavior. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 05:31:25 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 10:31:26 +0000 Received: from localhost ([127.0.0.1]:38236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7DQb-0003hv-K0 for submit@debbugs.gnu.org; Mon, 19 Dec 2022 05:31:25 -0500 Received: from mail-ej1-f53.google.com ([209.85.218.53]:46929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7DQZ-0003hm-QV for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 05:31:24 -0500 Received: by mail-ej1-f53.google.com with SMTP id bj12so20260611ejb.13 for <59956@debbugs.gnu.org>; Mon, 19 Dec 2022 02:31:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=MpZW/IxXI1ZquNjE0GoLSqv33PluNtDJ+8Wf34J4GxU=; b=hyVWwL63GYGPnOpt6o4e+xZY/mJGBlWUZfsx7SdSZxQiQFw/3ZY35QL+IONxntW2Pk F0NVakuk9R/YZ7DGfkJ0oBoN+ix7su6X30c/i1XktFnBRUkW27dUy0nkia57mO0e7nPn bsk1dLC21+M6Etl+7OpIYBlSjB7osLR8Ohk4xsKbBDMm/Z69enVlZRF1KWtJ0iUpBBCH gz7OQlChv+uLRxxrh29RIO4GNqW5uI70lmiTWmr3Lyhq1b53LJjqXrert9XgYDeZVZMp ZFRn9tooBNwOgm9R8S7g7oB0548CvadFMl2z7Yoq1palPp7rS8bQi1GddbGziifkBR2F l1Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MpZW/IxXI1ZquNjE0GoLSqv33PluNtDJ+8Wf34J4GxU=; b=iC5iVFRoO8wBdQ4xP0SgUgXEq/Kgqx3D+W9j+9vTING1GkbJfJkjY5Pb5mQhdClfda XhSMCRlXY+qIFYUlb+Ojn1V1HoN530q6jEptXa+vpRfzejDlzUcJhd1bMVMAiNZnVDiy OZKYMYJEdX6Jfyk3MuOzq5XU8j3DtIxXf5UW2GTx/GyKFwcb1z8FTPkdOo5ZKKCP1pgB 4+4W7JUQqDlkWzEjJUgIAT8Wbrm8/yg3cK70kbzushDru8T+MPGQ0XMRLWkohAr7amH4 ICyhbIZuv5MQOz/jgM4272KFvYK7zsHuRBAONV/3/0pE5Ea8IlRfTWZh3C6sFUlRzdGe vLcA== X-Gm-Message-State: ANoB5pkHnnRVXHIEPaRgHFgvJsvKtZ22WkzULOQv9Z6na5z3codGz54c YXBm/ZreevfOz8HZsX4x6T9a1HpirswWPg== X-Google-Smtp-Source: AA0mqf52fJ+jsm6FVcb31yjYU62Lu63pUSS8Bp0Z0r3KnG8CP7Xo9h3a7MlMT3N4PwnuKsV6pmcLnw== X-Received: by 2002:a17:907:ca2:b0:7c1:26b9:c556 with SMTP id gi34-20020a1709070ca200b007c126b9c556mr28740846ejc.15.1671445877593; Mon, 19 Dec 2022 02:31:17 -0800 (PST) Received: from ars3 ([2a02:8109:8ac0:56d0::a34]) by smtp.gmail.com with ESMTPSA id 9-20020a170906318900b0077a8fa8ba55sm4153363ejy.210.2022.12.19.02.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 02:31:16 -0800 (PST) From: Augusto Stoffel To: Stefan Monnier Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: (Stefan Monnier's message of "Sun, 18 Dec 2022 19:54:44 -0500") References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> Date: Mon, 19 Dec 2022 11:31:15 +0100 Message-ID: <87v8m7heh8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Gregory Heytings , Eli Zaretskii , 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, 18 Dec 2022 at 19:54, Stefan Monnier wrote: > 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 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 10:00:59 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 15:00:59 +0000 Received: from localhost ([127.0.0.1]:38645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7HdS-0003M7-V5 for submit@debbugs.gnu.org; Mon, 19 Dec 2022 10:00:59 -0500 Received: from heytings.org ([95.142.160.155]:36946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7HdR-0003M1-1a for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 10:00:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1671462055; bh=NwLCvYggxQnaNMLlMHLJwCqd/u1NXKxEdasJhyNUklI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=JzEXDjiMKKsCkf3O+qpXV7svtqhB373dtxqqp7VB0tJUkiDakXRYnKFB3UQgkTnb1 Uibphcx0jSJ4AvkvwycesaGjnVuy8gr97V8UT6Xlo0jGnLEr7Q1ZjAuz0r3gvnpBNi TWWsdCI/X1IgeM4KPh2zVMt7bw2hBJLJzOrjdn2rDGCZLPjvvTMwwY6f9hsScZTndk nC2MkjILNqPVAsK57V/SKRJy6gSTUgOWYIiryDxaxBQIf+7+t37d7mCPH/boOiqGE/ Hv0f6MrNC30pVfx6pgOF8Ao3hWbkw4qRHBk7RVgoeAQSCa7C+rIG1fC/eDHhUr1OVH xMNqI1Xrl7/6Q== Date: Mon, 19 Dec 2022 15:00:55 +0000 From: Gregory Heytings To: Stefan Monnier Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: 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; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > The more I think about it, the more my workaround sounds appealing. > What do you think of this (based on Augusto's suggestion)? It seems to me that it's a more elegant workaround, with which further improvements become possible, which isn't the case if we squeeze the value into a string. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 4e3a88bbda8..2a2bbf114e0 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -645,13 +645,25 @@ pcomplete-arg The OFFSET argument is added to/taken away from the index that will be used. This is really only useful with `first' and `last', for -accessing absolute argument positions." - (nth (+ (pcase index - ('first 0) - ('last pcomplete-last) - (_ (- pcomplete-index (or index 0)))) - (or offset 0)) - pcomplete-args)) +accessing absolute argument positions. + +When the INDEXth argument has been transformed into something +that is not a string by `pcomplete-parse-arguments-function', the +text representation of the argument is returned, and its value is +stored in its pcomplete-arg-value text property." + (let ((arg + (nth (+ (pcase index + ('first 0) + ('last pcomplete-last) + (_ (- pcomplete-index (or index 0)))) + (or offset 0)) + pcomplete-args))) + (if (stringp arg) + arg + (propertize + (buffer-substring (pcomplete-begin index offset) + (pcomplete-begin (1- (or index 0)) offset)) + 'pcomplete-arg-value arg)))) (defun pcomplete-begin (&optional index offset) "Return the beginning position of the INDEXth argument. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 11:21:11 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 16:21:11 +0000 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 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 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) 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== 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) From: Stefan Monnier To: Augusto Stoffel Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <87v8m7heh8.fsf@gmail.com> (Augusto Stoffel's message of "Mon, 19 Dec 2022 11:31:15 +0100") Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <87v8m7heh8.fsf@gmail.com> Date: Mon, 19 Dec 2022 11:21:00 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.405 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Gregory Heytings , Eli Zaretskii , 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 11:22:49 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 16:22:49 +0000 Received: from localhost ([127.0.0.1]:39042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Iuf-0004P2-F0 for submit@debbugs.gnu.org; Mon, 19 Dec 2022 11:22:49 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Iud-0004Ow-Hk for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 11:22:48 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 47E051007F3; Mon, 19 Dec 2022 11:22:42 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 823661002D6; Mon, 19 Dec 2022 11:22:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671466960; bh=vca2S9/krjI7Qdyuqwh76U/5kvARPwbvAudFJRikck4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RyeFOHdSRcCw50z5TbWR0nlDoeXX63ya82cAjjfhUCrKrxPvCH2isYsBfNEFH+lrd fNjMdj61oATZFe2nyJD5HX+59Gh9+hvuNJyl3D0aHfHQ+7A/ZXznmo7kWMcCWfvC1+ YVco94FF4KjVf6fP2P1HRAFALmvxwqLrNF07cuLOIKrXQT5gzGc9TBzudQJt3J2ez0 5RB4c5VNz145IF7/6XAJZRLK95R8VVZyacb9jWNSD3Qsd0asAfXdIZCV80LFEYr8W6 DixfG2cjCFBKlmxyFLL1cN26VXWwZJPLzQc7Oik8NyHbvUdQhNUnlH/0X5vuaMyKW5 h0yczUtZV3qqg== Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 45102123063; Mon, 19 Dec 2022 11:22:40 -0500 (EST) From: Stefan Monnier To: Gregory Heytings Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: (Gregory Heytings's message of "Mon, 19 Dec 2022 15:00:55 +0000") Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> Date: Mon, 19 Dec 2022 11:22:20 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.401 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > What do you think of this (based on Augusto's suggestion)? It seems to me > that it's a more elegant workaround, with which further improvements become > possible, which isn't the case if we squeeze the value into a string. Sounds good to me, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 13:05:03 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 18:05:03 +0000 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 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 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) 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) Message-ID: <64fc569c-6e35-139c-f2bc-e56845e57dc4@gmail.com> Date: Mon, 19 Dec 2022 10:04:51 -0800 MIME-Version: 1.0 Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Content-Language: en-US To: Augusto Stoffel , Stefan Monnier References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <87v8m7heh8.fsf@gmail.com> From: Jim Porter In-Reply-To: <87v8m7heh8.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: John Wiegley , Gregory Heytings , Eli Zaretskii , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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? From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 19 17:22:43 2022 Received: (at 59956) by debbugs.gnu.org; 19 Dec 2022 22:22:43 +0000 Received: from localhost ([127.0.0.1]:40690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OWw-0008F4-Pe for submit@debbugs.gnu.org; Mon, 19 Dec 2022 17:22:43 -0500 Received: from heytings.org ([95.142.160.155]:37446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7OWu-0008Ey-JL for 59956@debbugs.gnu.org; Mon, 19 Dec 2022 17:22:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1671488559; bh=f2IlWhPZQMJhr/0i1d3MUO171VHbYcM29Hs8b6qOxfA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=vlxUsT3eVasARpxx7YOmzOBIHYkDnaS5TgzJ1rPOEWiiKpHAZxR2flXE5mQneKQqg 4wO9dvTCFS3pyeVk1GNB8916iwtDJ/CSvHrK6yHwAnmW9D5NpIfUlHs11ZvI0QuFEH evNGwK8mWPvJHEioe73247d2+TjxbRanFgKcFoP9rvvq2qvYjXeMd34JEDB4f4SeYr dLW1pChUg3DbxoGoP2heGc5ZG0qCqkyxnrcDRJ5p1/uiT4FiowpDFwAiNMxdZyliQ6 6w85+76FR7dl6LviLzHSu/5yc6E40cFdybVuS5KglLDNTBIwvip3UvBdeVMf3X3l01 8SRK79VUjHVWQ== Date: Mon, 19 Dec 2022 22:22:38 +0000 From: Gregory Heytings To: Stefan Monnier Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="SvEMGz1yjF" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: Jim Porter , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org, John Wiegley X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --SvEMGz1yjF Content-Type: text/plain; format=flowed; charset=us-ascii > > Sounds good to me, > Thanks. Augusto and Jim, can you please try the attached patch and tell us if it fixes the issue without introducing regressions? --SvEMGz1yjF Content-Type: text/x-diff; name=Handle-non-string-values-in-pcomplete.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Handle-non-string-values-in-pcomplete.patch RnJvbSA1YmVlOWQ4YmVjNDJkZGYzOGJiN2U4ZDhmMmExYjM2YWRiOTZhNTA2 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBNb24sIDE5IERl YyAyMDIyIDIyOjE4OjIyICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIEhhbmRs ZSBub24tc3RyaW5nIHZhbHVlcyBpbiBwY29tcGxldGUNCg0KKiBsaXNwL3Bj b21wbGV0ZS5lbCAocGNvbXBsZXRlLWFyZyk6IFdoZW4NCnBjb21wbGV0ZS1w YXJzZS1hcmd1bWVudHMtZnVuY3Rpb24gcmV0dXJucyBhIG5vbi1zdHJpbmcg dmFsdWUsDQpyZXR1cm4gdGhlIHN0cmluZyB0aGUgdXNlciB0eXBlZCBpbiwg YW5kIGF0dGFjaCB0aGUgdmFsdWUgYXMgYQ0KdGV4dCBwcm9wZXJ0eSB0byB0 aGF0IHN0cmluZy4gIEZpeGVzIGJ1ZyM1OTk1NiBhbmQgYnVnIzYwMDIxLg0K LS0tDQogbGlzcC9wY29tcGxldGUuZWwgfCAyNyArKysrKysrKysrKysrKysr KysrKy0tLS0tLS0NCiAxIGZpbGUgY2hhbmdlZCwgMjAgaW5zZXJ0aW9ucygr KSwgNyBkZWxldGlvbnMoLSkNCg0KZGlmZiAtLWdpdCBhL2xpc3AvcGNvbXBs ZXRlLmVsIGIvbGlzcC9wY29tcGxldGUuZWwNCmluZGV4IDRlM2E4OGJiZGE4 Li5iMWZiZDg4YTM3NyAxMDA2NDQNCi0tLSBhL2xpc3AvcGNvbXBsZXRlLmVs DQorKysgYi9saXNwL3Bjb21wbGV0ZS5lbA0KQEAgLTY0NSwxMyArNjQ1LDI2 IEBAIHBjb21wbGV0ZS1hcmcNCiANCiBUaGUgT0ZGU0VUIGFyZ3VtZW50IGlz IGFkZGVkIHRvL3Rha2VuIGF3YXkgZnJvbSB0aGUgaW5kZXggdGhhdCB3aWxs IGJlDQogdXNlZC4gIFRoaXMgaXMgcmVhbGx5IG9ubHkgdXNlZnVsIHdpdGgg YGZpcnN0JyBhbmQgYGxhc3QnLCBmb3INCi1hY2Nlc3NpbmcgYWJzb2x1dGUg YXJndW1lbnQgcG9zaXRpb25zLiINCi0gIChudGggKCsgKHBjYXNlIGluZGV4 DQotCSAgICgnZmlyc3QgMCkNCi0JICAgKCdsYXN0ICBwY29tcGxldGUtbGFz dCkNCi0JICAgKF8gICAgICAoLSBwY29tcGxldGUtaW5kZXggKG9yIGluZGV4 IDApKSkpDQotCSAgKG9yIG9mZnNldCAwKSkNCi0gICAgICAgcGNvbXBsZXRl LWFyZ3MpKQ0KK2FjY2Vzc2luZyBhYnNvbHV0ZSBhcmd1bWVudCBwb3NpdGlv bnMuDQorDQorV2hlbiB0aGUgYXJndW1lbnQgaGFzIGJlZW4gdHJhbnNmb3Jt ZWQgaW50byBzb21ldGhpbmcgdGhhdCBpcyBub3QNCithIHN0cmluZyBieSBg cGNvbXBsZXRlLXBhcnNlLWFyZ3VtZW50cy1mdW5jdGlvbicsIHRoZSB0ZXh0 DQorcmVwcmVzZW50YXRpb24gb2YgdGhlIGFyZ3VtZW50LCBuYW1lbHkgd2hh dCB0aGUgdXNlciBhY3R1YWxseQ0KK3R5cGVkIGluLCBpcyByZXR1cm5lZCwg YW5kIHRoZSB2YWx1ZSBvZiB0aGUgYXJndW1lbnQgaXMgc3RvcmVkIGluDQor dGhlIHBjb21wbGV0ZS1hcmctdmFsdWUgdGV4dCBwcm9wZXJ0eSBvZiB0aGF0 IHN0cmluZy4iDQorICAobGV0ICgoYXJnDQorICAgICAgICAgKG50aCAoKyAo cGNhc2UgaW5kZXgNCisJICAgICAgICAgICAoJ2ZpcnN0IDApDQorCSAgICAg ICAgICAgKCdsYXN0ICBwY29tcGxldGUtbGFzdCkNCisJICAgICAgICAgICAo XyAgICAgICgtIHBjb21wbGV0ZS1pbmRleCAob3IgaW5kZXggMCkpKSkNCisJ ICAgICAgICAgKG9yIG9mZnNldCAwKSkNCisgICAgICAgICAgICAgIHBjb21w bGV0ZS1hcmdzKSkpDQorICAgIChpZiAoc3RyaW5ncCBhcmcpDQorICAgICAg ICBhcmcNCisgICAgICAocHJvcGVydGl6ZQ0KKyAgICAgICAoYnVmZmVyLXN1 YnN0cmluZyAocGNvbXBsZXRlLWJlZ2luIGluZGV4IG9mZnNldCkNCisgICAg ICAgICAgICAgICAgICAgICAgICAgKHBjb21wbGV0ZS1iZWdpbiAoMS0gKG9y IGluZGV4IDApKSBvZmZzZXQpKQ0KKyAgICAgICAncGNvbXBsZXRlLWFyZy12 YWx1ZSBhcmcpKSkpDQogDQogKGRlZnVuIHBjb21wbGV0ZS1iZWdpbiAoJm9w dGlvbmFsIGluZGV4IG9mZnNldCkNCiAgICJSZXR1cm4gdGhlIGJlZ2lubmlu ZyBwb3NpdGlvbiBvZiB0aGUgSU5ERVh0aCBhcmd1bWVudC4NCi0tIA0KMi4z NS4xDQoNCg== --SvEMGz1yjF-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 01:33:02 2022 Received: (at 59956) by debbugs.gnu.org; 21 Dec 2022 06:33:02 +0000 Received: from localhost ([127.0.0.1]:49754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7sf0-0002g6-7y for submit@debbugs.gnu.org; Wed, 21 Dec 2022 01:33:02 -0500 Received: from mail-pj1-f54.google.com ([209.85.216.54]:55067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7sex-0002fi-Jj for 59956@debbugs.gnu.org; Wed, 21 Dec 2022 01:33:00 -0500 Received: by mail-pj1-f54.google.com with SMTP id x3so426649pjv.4 for <59956@debbugs.gnu.org>; Tue, 20 Dec 2022 22:32:59 -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=CTmGRZLoRp6MyNZNGqaf+t4zxj9fdXwBShQugNnODgU=; b=oMd/4dkq7f5PstE8SnETa31Ojq5DJ5mKDybO7n0jQVHViL5jGjVr4YaZksg8RqfM16 u4ZsQOttv0iuwbQTWeVsqJgSyeYjaFyA6iBkBNN3rQnX7q7DW00XnyUCNSFiLk/hJ9sS 7IKyd0sLfi/S25ge2E6Y1vfqwjswA/b4FM3QiqAwwtTuMM9/hShpaM3AJwOTEk7XtQxH Dhvd4HuUpJJaBUT69IHdjp6UzGKPI+uJtDRPO3F8KxRCHQwVqD+2l+tEIbQ+Eqep61ss PQ2eq3G4t9gOjYBlrNP6wrcAu5pDhipu0ycS8r4GjrPiYlV7HXeJ10xSfF6S8BfO2XQx hb+Q== 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=CTmGRZLoRp6MyNZNGqaf+t4zxj9fdXwBShQugNnODgU=; b=StaR5cg/TM28Zt+OPobwQsmNQTzgHlNNYeW8azz3OIUZCoroPCi7NHYnvhm0HZUid+ o4lVmVY/sS+nLoRTKXWKy6C0MgO4t5SbVFBVPRkMkRS+3mG2fgIInWM6P17IJyBkGUIs qz6HHnuiEyDtkTcIlRf1spYT9RIvf9BNoXMioMUmYXgoSFzhUoVrxd1OKRGqxC74ZPdl fj7imWcKGiGpNtwWM8yW0FRopfZXobu1qdoWhi6TusS6JSfONnCU10dqJfhvzZ4+AhL4 H/jRptpj3KL6yl2UdDbR5vh+vrEvoFjSUb2tWcFuCZLdS9cq/vzxJYJU+r0iY8A9elcx 2hEw== X-Gm-Message-State: AFqh2kq15ExUuv5t7KXBn8t4hdNRa4hgn6ZkoyIzlGRYtIyc5hPBRiy2 +7IyhyH4MLXFyKP/N4h6BXw= X-Google-Smtp-Source: AMrXdXs89KFPzs3GPpSBlaY/7Y52l1UGz2Q3dvf0QEnA/kdF8BKpbRsdKqkS2oeYTrUytTJAuy6tCQ== X-Received: by 2002:a17:902:680f:b0:189:bbd3:a5a7 with SMTP id h15-20020a170902680f00b00189bbd3a5a7mr826484plk.51.1671604373651; Tue, 20 Dec 2022 22:32:53 -0800 (PST) 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 p6-20020a170902a40600b001766a3b2a26sm10506501plq.105.2022.12.20.22.32.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Dec 2022 22:32:53 -0800 (PST) Message-ID: <0d1eac42-1ea4-46d5-6236-eebfa75618ec@gmail.com> Date: Tue, 20 Dec 2022 22:32:52 -0800 MIME-Version: 1.0 Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation Content-Language: en-US To: Gregory Heytings , Stefan Monnier References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> From: Jim Porter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: John Wiegley , Eli Zaretskii , arstoffel@gmail.com, 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/19/2022 2:22 PM, Gregory Heytings wrote: > Augusto and Jim, can you please try the attached patch and tell us if it > fixes the issue without introducing regressions? It works for me after a bit of testing, thanks. I don't see any regressions on the Eshell side of things, at least. While it would be nice to have a way for Eshell to provide multiple forms of its arguments for completion (one for external commands that expect a flat list of strings, and another for Eshell commands), that seems like a lot more work that would probably be better spent elsewhere. (And a change like that would be too big for the release branch anyway.) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 21 04:28:47 2022 Received: (at 59956) by debbugs.gnu.org; 21 Dec 2022 09:28:47 +0000 Received: from localhost ([127.0.0.1]:50612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7vP5-0004QR-Ak for submit@debbugs.gnu.org; Wed, 21 Dec 2022 04:28:47 -0500 Received: from heytings.org ([95.142.160.155]:39466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7vP3-0004QL-GF for 59956@debbugs.gnu.org; Wed, 21 Dec 2022 04:28:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1671614924; bh=AnaEvanWQb6iX3dHQOHt7O4+k9OikfAYpi1xHWcE+kk=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=EB0r++Za3/Gdn90zLPceW0Taca1eMeGgmmkReMrlR0PWbRRRzXR1YVHjgBM5zPjky raWG+MPRfJshMcmdwxI4/gcn8ny9S9m3TBYV8/aBsAJzXVyCCHRD1XkILhinO9KDuF uPsll+LUN6WMzXPVdUAVqEZXwHqyshvOOL2ViO39e+awR5eChZC7WudrYz6UkYmnMp /YYghJKEwfJ8/uhZv8M/dOKKn8WJtwpInxv1KWNITgwg8l6vaW3jsQo316g0OUXsmT FXYWRqHkaPVB+lm2s8aKKx+xWaREpLuKxTpnUFwKnXIRptOl4BFO0Jp+Hz9QwQ1Ucw npJHxZdS2iWvQ== Date: Wed, 21 Dec 2022 09:28:43 +0000 From: Gregory Heytings To: Jim Porter Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: <0d1eac42-1ea4-46d5-6236-eebfa75618ec@gmail.com> Message-ID: References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <0d1eac42-1ea4-46d5-6236-eebfa75618ec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956 Cc: John Wiegley , Eli Zaretskii , arstoffel@gmail.com, Stefan Monnier , 59956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Augusto and Jim, can you please try the attached patch and tell us if >> it fixes the issue without introducing regressions? > > It works for me after a bit of testing, thanks. I don't see any > regressions on the Eshell side of things, at least. > Thanks for your feedback! > > While it would be nice to have a way for Eshell to provide multiple > forms of its arguments for completion (one for external commands that > expect a flat list of strings, and another for Eshell commands), that > seems like a lot more work that would probably be better spent > elsewhere. (And a change like that would be too big for the release > branch anyway.) > Indeed. There are two levels involved here: the pcomplete one and the eshell one. The patch makes the pcomplete level more robust by ensuring that, even if pcomplete-parse-arguments-function does not return strings (which was an implicit assumption), pcomplete will continue to work. On the eshell level, it would probably be better add a companion function to eshell-complete-parse-arguments (which is used for pcomplete-parse-arguments-function) that would return a proper string representation of the expanded arguments, and to use it for pcomplete-parse-arguments-function, instead of eshell-complete-parse-arguments. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 17:02:48 2022 Received: (at 59956-done) by debbugs.gnu.org; 29 Dec 2022 22:02:48 +0000 Received: from localhost ([127.0.0.1]:33072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pB0zA-0001Vn-GJ for submit@debbugs.gnu.org; Thu, 29 Dec 2022 17:02:48 -0500 Received: from heytings.org ([95.142.160.155]:50696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pB0z9-0001Vf-OO for 59956-done@debbugs.gnu.org; Thu, 29 Dec 2022 17:02:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672351366; bh=z1y8dlOqPktWkjBf+bdvHHy81qefyPs6KyNboYYfElY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=6L+79JY+yYE+k14MtUhWB0ICDYRfNtHAS5b9BYbU6d4wCLDr4O1e4Re3rj+hZZmPX e7O8dRENIDPPgnk9XNoPXKjt+LN/fttJwgxK/4emoAt4qvKO0zUJNdQSR1+mmSwXEV d2OEWDq6mi7z3w8cvRle2IOjwmVl+jIVrNlH5rA4UopGFCabb53E1VmHkHOjegwbj6 /x24Y8ZAsRmS4pQ+bVILGQbL1cl6IrWThvMNcZjFRl0nClEMThe+L+JG+hiFa0qih2 sR4As6ivpu7J5+elEi5f8J9ngQsUOMCdkAEBeI+ONsZfpbiKNCexFjWwkf4NdMSdOw M8pGTMAnDA3XQ== Date: Thu, 29 Dec 2022 22:02:45 +0000 From: Gregory Heytings To: Jim Porter Subject: Re: bug#59956: 29.0.60: Failure when completing arguments in Eshell after variable interpolation In-Reply-To: Message-ID: <86ce0848031e376dddaf@heytings.org> References: <83iliiv0yv.fsf@gnu.org> <765547c0-b2a5-b054-a29d-b27002b7442c@gmail.com> <07bcf6a532d0428b9f53@heytings.org> <0d1eac42-1ea4-46d5-6236-eebfa75618ec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59956-done Cc: John Wiegley , Eli Zaretskii , arstoffel@gmail.com, Stefan Monnier , 59956-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) No further comments in a week, pushed (dafa6d6bad) and closing. From unknown Sat Aug 16 16:01:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 Jan 2023 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator