unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Mattias Engdegård" <mattiase@acm.org>,
	"martin rudalics" <rudalics@gmx.at>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Invoking gdb hangs after tweak in comint.el
Date: Mon, 18 Mar 2019 17:47:29 -0700	[thread overview]
Message-ID: <a0a385bc-f50f-0a40-28df-315abfa86e22@cs.ucla.edu> (raw)
In-Reply-To: <48c720eddbcc3f378465cdd47813a2ff49da2004.camel@acm.org>

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

On 3/12/19 5:07 AM, Mattias Engdegård wrote:
>
> A comint expert needs to look at it, but since the loop never worked,
> perhaps it could be removed entirely?

Stefan would be a good person to look at it since he wrote the code. In
the meantime I installed the attached, with a commit message that I hope
explains things.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Remove-buggy-regexp-use-in-comint-output-filter.patch --]
[-- Type: text/x-patch; name="0001-Remove-buggy-regexp-use-in-comint-output-filter.patch", Size: 2202 bytes --]

From 8bd3aa929a0ce6510d7c7550070f569caa65ec5e Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 18 Mar 2019 17:44:21 -0700
Subject: [PATCH] Remove buggy regexp use in comint-output-filter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 2012-07-02T16:18:02!monnier@iro.umontreal.ca
which perhaps could be rethought and recommitted, and perhaps
it’s no longer needed now that comint-use-prompt-regexp
is almost always nil.
* lisp/comint.el (comint-output-filter): Don’t try to skip
repeated prompts, since comint-prompt-regexp typically begins
with "^" and the resulting "^^" in the regular expression does
not have the desired effect.  Noted by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00380.html
---
 lisp/comint.el | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index a71821baa5..d21cc1378f 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2072,20 +2072,6 @@ comint-output-filter
 	    (goto-char (process-mark process))
 	    (set-marker comint-last-output-start (point))
 
-            ;; Try to skip repeated prompts, which can occur as a result of
-            ;; commands sent without inserting them in the buffer.
-            (let ((bol (save-excursion (forward-line 0) (point)))) ;No fields.
-              (when (and (not (bolp))
-                         (looking-back comint-prompt-regexp bol))
-                (let* ((prompt (buffer-substring bol (point)))
-                       (prompt-re (concat "\\`" (regexp-quote prompt))))
-                  (while (string-match prompt-re string)
-                    (setq string (substring string (match-end 0)))))))
-            (while (string-match (concat "\\(^" comint-prompt-regexp
-                                         "\\)\\1+")
-                                 string)
-              (setq string (replace-match "\\1" nil nil string)))
-
 	    ;; insert-before-markers is a bad thing. XXX
 	    ;; Luckily we don't have to use it any more, we use
 	    ;; window-point-insertion-type instead.
-- 
2.20.1


  reply	other threads:[~2019-03-19  0:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  9:51 Invoking gdb hangs after tweak in comint.el martin rudalics
2019-03-12 12:07 ` Mattias Engdegård
2019-03-19  0:47   ` Paul Eggert [this message]
2019-04-23  9:21     ` martin rudalics

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=a0a385bc-f50f-0a40-28df-315abfa86e22@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    --cc=rudalics@gmx.at \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).