emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c093667: Remove buggy regexp use in comint-output-f


From: Paul Eggert
Subject: [Emacs-diffs] master c093667: Remove buggy regexp use in comint-output-filter
Date: Mon, 18 Mar 2019 20:44:58 -0400 (EDT)

branch: master
commit c0936672876bccc15e7899e83d8ab99910f8feee
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Remove buggy regexp use in comint-output-filter
    
    This reverts commit 2012-07-02T16:18:address@hidden
    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 a71821b..d21cc13 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2072,20 +2072,6 @@ Make backspaces delete the previous character."
            (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]