From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#42662: 27.1; `comint-redirect-results-list-from-process' treats COMMAND as a regexp Date: Sun, 2 Aug 2020 15:27:17 +1200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------374067941600B9861E6F1F67" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11126"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 To: 42662@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 02 05:28:10 2020 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 1k24fS-0002lH-4W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 05:28:10 +0200 Original-Received: from localhost ([::1]:55076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k24fQ-0001Mf-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Aug 2020 23:28:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k24fK-0001MT-Ki for bug-gnu-emacs@gnu.org; Sat, 01 Aug 2020 23:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k24fK-0001g3-BU for bug-gnu-emacs@gnu.org; Sat, 01 Aug 2020 23:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k24fK-0004YN-8N for bug-gnu-emacs@gnu.org; Sat, 01 Aug 2020 23:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Aug 2020 03:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42662 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159633884617459 (code B ref -1); Sun, 02 Aug 2020 03:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Aug 2020 03:27:26 +0000 Original-Received: from localhost ([127.0.0.1]:41338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k24ej-0004XX-Rc for submit@debbugs.gnu.org; Sat, 01 Aug 2020 23:27:26 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k24eh-0004XN-QN for submit@debbugs.gnu.org; Sat, 01 Aug 2020 23:27:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k24eh-0001KA-JS for bug-gnu-emacs@gnu.org; Sat, 01 Aug 2020 23:27:23 -0400 Original-Received: from smtp-1.orcon.net.nz ([60.234.4.34]:45105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k24ef-0001fZ-GX for bug-gnu-emacs@gnu.org; Sat, 01 Aug 2020 23:27:23 -0400 Original-Received: from [101.53.216.96] (port=26472 helo=[192.168.20.103]) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1k24eX-0001mm-JZ for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 15:27:13 +1200 Content-Language: en-GB X-GeoIP: NZ Received-SPF: pass client-ip=60.234.4.34; envelope-from=psainty@orcon.net.nz; helo=smtp-1.orcon.net.nz X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/01 23:27:14 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:183802 Archived-At: This is a multi-part message in MIME format. --------------374067941600B9861E6F1F67 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I encountered this when sending a COMMAND ending in a backslash to the inferior comint process, and getting Debugger entered--Lisp error: (invalid-regexp "Trailing backslash"). E.g. M-x comint-run RET cat RET M-: (comint-redirect-results-list "\\" ".+" 0) Debugger entered--Lisp error: (invalid-regexp "Trailing backslash") (looking-at "\\") (comint-redirect-results-list-from-process # "\\" ".*" 0) (comint-redirect-results-list "\\" ".*" 0) (eval (comint-redirect-results-list "\\" ".*" 0) nil) (eval-expression (comint-redirect-results-list "\\" ".*" 0) nil nil 127) (funcall-interactively eval-expression (comint-redirect-results-list "\\" ".*" 0) nil nil 127) (call-interactively eval-expression nil nil) (command-execute eval-expression) Patch attached. Shall I commit this to emacs-27? -Phil In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2020-08-02 built on shodan Repository revision: f54ddb0198640e38c1d34bf6031ff5117c117c85 Repository branch: emacs-27 Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 18.04.4 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --prefix=/home/phil/emacs/27.0/usr/local --with-x-toolkit=lucid --without-sound' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8 Major mode: Dired by name Minor modes in effect: show-paren-mode: t minibuffer-depth-indicate-mode: t winner-mode: t global-hl-line-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-x easymenu paren mb-depth winner ring hl-line dired dired-loaddefs advice tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 49706 7202) (symbols 48 6423 1) (strings 32 17502 1501) (string-bytes 1 554965) (vectors 16 9973) (vector-slots 8 130782 9032) (floats 8 29 25) (intervals 56 250 0) (buffers 1000 13)) --------------374067941600B9861E6F1F67 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-usage-of-literal-text-as-regexp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-usage-of-literal-text-as-regexp.patch" >From be456b8592429f0542113e0a433a6b977135d094 Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Sun, 2 Aug 2020 13:03:27 +1200 Subject: [PATCH] Fix usage of literal text as regexp * lisp/comint.el (comint-redirect-results-list-from-process): Use 'regexp-quote' when checking whether literal string COMMAND was inserted into the buffer. --- lisp/comint.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/comint.el b/lisp/comint.el index bf376a0..3e76c5d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3835,7 +3835,7 @@ comint-redirect-results-list-from-process (set-buffer output-buffer) (goto-char (point-min)) ;; Skip past the command, if it was echoed - (and (looking-at command) + (and (looking-at (regexp-quote command)) (forward-line)) (while (and (not (eobp)) (re-search-forward regexp nil t)) -- 2.8.3 --------------374067941600B9861E6F1F67--