all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: 42662@debbugs.gnu.org
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	[thread overview]
Message-ID: <daa0783b-04f8-8649-0911-1dc980ad7635@orcon.net.nz> (raw)

[-- Attachment #1: Type: text/plain, Size: 3869 bytes --]

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 #<process cat> "\\" ".*" 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))

[-- Attachment #2: 0001-Fix-usage-of-literal-text-as-regexp.patch --]
[-- Type: text/x-patch, Size: 914 bytes --]

From be456b8592429f0542113e0a433a6b977135d094 Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@orcon.net.nz>
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


             reply	other threads:[~2020-08-02  3:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02  3:27 Phil Sainty [this message]
2020-08-02 14:09 ` bug#42662: 27.1; `comint-redirect-results-list-from-process' treats COMMAND as a regexp Eli Zaretskii
2020-08-12 13:35   ` Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daa0783b-04f8-8649-0911-1dc980ad7635@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=42662@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.