From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#54603: 29.0.50; [PATCH] Eshell's external pipe module interferes with other argument parsing hooks Date: Thu, 31 Mar 2022 15:19:58 -0700 Message-ID: References: <70677cd2-f741-16d1-b38f-c39b507cc95e@gmail.com> <871qyij7vx.fsf@melete.silentflame.com> <87bkxliy76.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21864"; mail-complaints-to="usenet@ciao.gmane.io" To: Sean Whitton , 54603@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 01 00:28:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1na3HL-0005Xz-KW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Apr 2022 00:28:31 +0200 Original-Received: from localhost ([::1]:34362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1na3HK-0003dV-Kw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Mar 2022 18:28:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na3A6-00020S-NX for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 18:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1na3A6-0001gK-Cn for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 18:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1na3A6-0003Vt-4r for bug-gnu-emacs@gnu.org; Thu, 31 Mar 2022 18:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Mar 2022 22:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54603 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54603-submit@debbugs.gnu.org id=B54603.164876520713416 (code B ref 54603); Thu, 31 Mar 2022 22:21:02 +0000 Original-Received: (at 54603) by debbugs.gnu.org; 31 Mar 2022 22:20:07 +0000 Original-Received: from localhost ([127.0.0.1]:40074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na39D-0003UK-EP for submit@debbugs.gnu.org; Thu, 31 Mar 2022 18:20:07 -0400 Original-Received: from mail-pj1-f42.google.com ([209.85.216.42]:46639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na39B-0003Tj-CY for 54603@debbugs.gnu.org; Thu, 31 Mar 2022 18:20:05 -0400 Original-Received: by mail-pj1-f42.google.com with SMTP id bx24-20020a17090af49800b001c6872a9e4eso743232pjb.5 for <54603@debbugs.gnu.org>; Thu, 31 Mar 2022 15:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benMVtUI82sERn3xauDeGC/XsnMJ8mHslzkW2OrJwl0=; b=ArpwbnSHYpdT6XYUZuuPDdLoxTkSYBjur6ZKDzf+vdUgBrtUPbS60xSPqW4L6uAty7 4dZZp13R/BzzbhnYNG6AJpMhSec7QrqjIStPKCIJLtU6TNxr1mP0ALVdgVjepBVa0MJO LxFT5zCSlmki8ItpB345XrhzFpiuV3yxh0ToM4N4jMrGsyK0AyIL9l00k5BNGKIdZzJv ljmoJZL4IFzTs8vd6+sF/GUW1A5r1fWZJm3PeUywdZQUrVN20KTwz22jjQO5IHcrWU36 /PJch+uqu/ussS5Jtgqtog9m05CMN27KFP9OLB1pOt/Su4JPTVWaJ7I0NE0IJ/M235X/ bo2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=benMVtUI82sERn3xauDeGC/XsnMJ8mHslzkW2OrJwl0=; b=3DzJhHZ0UToDoHnjAjSClDPvqbeoIOwRgKw1e/ZQJH6Pj6Q0xbrh2d4ol0I3XdLebz rzG1W6hJdnn9Jmlqc6kf4PTsNB/SXm4jgjlemMPp5A3k3rScnYyOoU3u+sco7BaEIvlF IExyno+vzpWMf21ikLwsmt7K3ZwiSxnywc2ZxGgsLEJFrzEfD8AYqbnDrbIBcwI+CYhS piu5ZgKAX2ZMFYx4hBmPuUpz5ntAqPfFLIz9CydQgfLeZ0nw1begz0XKbwcM1nhet/Cg H+zM3Tl4H3H7RkKUMVaQwclXlFU+jni2EMgAGJ2xIVZ84GCagq6TemXchmBQr1uGb+im cKbA== X-Gm-Message-State: AOAM532m0Qyh0aTKGK7VpNUbbaR+9TYhcYfZzFFckclMyeTQeoPRURNX SysEyzHHWE91WtRd+I55dWyoWcunjBA= X-Google-Smtp-Source: ABdhPJxZCZflZ0QiGpr68QSVKjVUZbe9xQvuBvXOGcyTGBAxX8sULIztlMUjnt1k/AvoDawgbqzpcg== X-Received: by 2002:a17:902:7e42:b0:156:47a6:c575 with SMTP id a2-20020a1709027e4200b0015647a6c575mr9470932pln.37.1648765199555; Thu, 31 Mar 2022 15:19:59 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id a11-20020a63cd4b000000b00378b9167493sm330098pgj.52.2022.03.31.15.19.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 15:19:59 -0700 (PDT) In-Reply-To: <87bkxliy76.fsf@melete.silentflame.com> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229187 Archived-At: On 3/31/2022 2:55 PM, Sean Whitton wrote: > On Thu 31 Mar 2022 at 01:58PM -07, Jim Porter wrote: > >> I'm not so sure. That would mean "'foo" in "echo 'foo" is treated as a >> Lisp form, but Eshell expects you to use "#'" (or "(" or "`") to >> introduce a Lisp form. As I understand it, that's so that typos don't do >> such surprising things. There's a good chance that a user typing "echo >> 'foo" actually meant "echo 'foo'". > > Right okay. We can just skip over entire Lisp forms when we find them. > I don't think there could be a non-highly esoteric shell command for > standard POSIX shells -- which is what this feature is for -- which that > would break. Like this: > >>> diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el >>> index eb5b3bfe1d..0787ab791b 100644 >>> --- a/lisp/eshell/em-extpipe.el >>> +++ b/lisp/eshell/em-extpipe.el >>> @@ -99,7 +99,7 @@ eshell-parse-external-pipeline >>> (let* ((found >>> (save-excursion >>> (re-search-forward >>> - "\\(?:#?'\\|\"\\|\\\\\\)" bound t))) >>> + "\\(?:(\\|#?'\\|\"\\|\\\\\\)" bound t))) >>> (next (or (and found (match-beginning 0)) >>> bound))) >>> (if (re-search-forward pat next t) >>> > > Something in my init.el is breaking the extpipe tests atm, but I ad hoc > tested one of your cases for this bug and it works. Could you confirm? The first test case -- "(eq 'foo nil)" -- works, but the second doesn't: ~ $ echo $(list "one" "two")(:s'o'x') Invalid read syntax: ")", 1, 33 Similarly: ~ $ echo *(:gs'o'x') Invalid read syntax: ")", 1, 16 I guess this is because it's now trying to read the argument modifier as a Lisp form. Normally, `eshell-parse-lisp-argument' would ignore that bit, since the `(' starting the modifier isn't at the beginning of an argument. This could probably be resolved with some additional logic (setting `eshell-current-argument' as appropriate?), but I hope there's a cleaner way that doesn't involve reimplementing `eshell-parse-argument' within `eshell-parse-external-pipeline'.