From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#53518: 29.0.50; em-extpipe breaks input of sharp-quoted Lisp symbols Date: Tue, 25 Jan 2022 09:48:16 -0700 Message-ID: <875yq7223z.fsf@athena.silentflame.com> References: <87h79s1isp.fsf@athena.silentflame.com> <87a6fk19no.fsf@athena.silentflame.com> <87sftcxap8.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21286"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 53518@debbugs.gnu.org, Michael Albinus , Jim Porter To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 25 17:50:59 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 1nCP1z-0005Ip-Cs for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 17:50:57 +0100 Original-Received: from localhost ([::1]:47350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCP1w-0003JA-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 11:50:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCP0A-0003GZ-BT for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 11:49:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCP09-0000tI-R0 for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 11:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCP09-00013U-Nk for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 11:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jan 2022 16:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53518 X-GNU-PR-Package: emacs Original-Received: via spool by 53518-submit@debbugs.gnu.org id=B53518.16431293144018 (code B ref 53518); Tue, 25 Jan 2022 16:49:01 +0000 Original-Received: (at 53518) by debbugs.gnu.org; 25 Jan 2022 16:48:34 +0000 Original-Received: from localhost ([127.0.0.1]:49911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCOzh-00012j-J9 for submit@debbugs.gnu.org; Tue, 25 Jan 2022 11:48:33 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:35619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCOzc-00012R-3v for 53518@debbugs.gnu.org; Tue, 25 Jan 2022 11:48:32 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 41B5E320232A; Tue, 25 Jan 2022 11:48:20 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 25 Jan 2022 11:48:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; bh=Xj2QQm07wmF+zhJ9zKjAv4uCdupZYI XVGT+aLnvdlUw=; b=3vkJHGdURRTkupErmguR3nG6Y4Dj7HEc75Kp3F6JV8CwqE DzBhgtquHCE7Qy7+6OgCOvEOfFMn/RySoiEU3oA9iRqpAyA2HzIQLAQAMikaLyYj fKDUIPzO+gQnp10NZxHIC9E225ZggzNstIXTBoKLXsAiEiMDBLSqo3qeFTugZqqK uL/x9eyhcKfxEoqRnGUBOq8sxr40XVFyMk6S7SW3oqJ/BdFJJJCZLz6P/LDCJJSo ybFwwR3UJehKq65LBQ+r68J8pcxS1VYZczs9uEsccfZ+p4vOSBUUpZe+8nlsIZIU lB0GwGd+qL2zVA+q0nvpTkFYDgWwty+LZthu6OJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Xj2QQm07wmF+zhJ9z KjAv4uCdupZYIXVGT+aLnvdlUw=; b=XCNQlzb3IR/n49Td5CGlqI/KUEB2/XSjd iTFBkU9je/MRbpasDUuNEJsT5iJcFJO0xo8v8NElc5WYiRRw2jrw4Yx2YNjbnJE7 Jmqqro5p0hrwOvTMCJ5UVea0nvfxwVPmegnoSaTsKkGjn4VKdrMlGt4R1fO7SQRe YTCUy0eeeSR3xJbLyCxA2XHYrVm5UvKzmUTeUeMMfjb5s/NFZisvH4Z8f0bUlDXi wmu1mJwIug4qKSKeo0oymzlbCfN6rfyeMhuPuLaLjSejCFbRuCTaUPjq1mMSj0kg Z5iQ0m9Lei8ZhMIu+aPahju1QXTchs7HvS2+Cs0fIrI6QOLhs6+nQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdelgdelvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesmhdttdertdertdenucfhrhhomhepufgvrghnucgh hhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefgueeutedvkeffgedvveetheejieetvdduvdffheevgfetvdfg hfetteffvdevjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Jan 2022 11:48:18 -0500 (EST) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id 4C13F1B6558; Tue, 25 Jan 2022 16:48:16 +0000 (UTC) In-Reply-To: <87sftcxap8.fsf@gnus.org> 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:225200 Archived-At: --=-=-= Content-Type: text/plain Hello, On Tue 25 Jan 2022 at 01:26pm +01, Lars Ingebrigtsen wrote: > This leads to the following compilation warning: > > ELC eshell/em-extpipe.elc > In end of data: > eshell/em-extpipe.el:107:38: Warning: the function `eshell-parse-lisp-argument' is not known to be defined. Apologies for this. Here is a fixed patch. -- Sean Whitton --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=v2-0001-Fix-input-of-sharp-quoted-symbols-in-Eshell-with-.patch >From 7981a5de5f06fd8879e57ac4d780370965999d7b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 24 Jan 2022 22:39:15 -0700 Subject: [PATCH v2] Fix input of sharp-quoted symbols in Eshell with em-extpipe * lisp/eshell/em-extpipe.el (eshell-parse-external-pipeline): Fix misinterpreting sharp-quoted symbols as the beginning of single-quoted strings (Bug#53518). Add protection against a possible infinite loop. * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-17): New test. --- lisp/eshell/em-extpipe.el | 13 ++++++++++--- test/lisp/eshell/em-extpipe-tests.el | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/eshell/em-extpipe.el b/lisp/eshell/em-extpipe.el index 57aeec38ff..eb5b3bfe1d 100644 --- a/lisp/eshell/em-extpipe.el +++ b/lisp/eshell/em-extpipe.el @@ -30,6 +30,7 @@ (require 'cl-lib) (require 'esh-arg) +(require 'esh-cmd) (require 'esh-io) (require 'esh-util) @@ -97,15 +98,21 @@ eshell-parse-external-pipeline (while (> bound (point)) (let* ((found (save-excursion - (re-search-forward "['\"\\]" bound t))) + (re-search-forward + "\\(?:#?'\\|\"\\|\\\\\\)" bound t))) (next (or (and found (match-beginning 0)) bound))) (if (re-search-forward pat next t) (throw 'found (match-beginning 1)) (goto-char next) - (while (or (eshell-parse-backslash) + (while (or (eshell-parse-lisp-argument) + (eshell-parse-backslash) (eshell-parse-double-quote) - (eshell-parse-literal-quote))))))))) + (eshell-parse-literal-quote))) + ;; Guard against an infinite loop if none of + ;; the parsers moved us forward. + (unless (or (> (point) next) (eobp)) + (forward-char 1)))))))) (goto-char (if (and result go) (match-end 0) start)) result))) (unless (or eshell-current-argument eshell-current-quoted) diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index 1283b6b361..0879ad5b0c 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -202,4 +202,8 @@ em-extpipe-test-16 (eshell-command-result-p input "rab") (eshell-command-result-p "echo \"bar\" | rev" "nonsense")))) +;; Confirm we don't break input of sharp-quoted symbols (Bug#53518). +(em-extpipe-tests--deftest em-extpipe-test-17 "funcall #'upcase foo" + (eshell-command-result-p input "FOO")) + ;;; em-extpipe-tests.el ends here -- 2.30.2 --=-=-=--