|
From: | Richard Sharman |
Subject: | bug#45952: Correction to: Re: 27.1; Certain regexps can cause comint-redirect-results-list-from-process to loop. |
Date: | Sun, 17 Jan 2021 21:48:16 -0800 |
Sorry, there was a mistake on the patch on my previous message; the (re-search-forward regexp nil t)) was inadvertently changed to (re-search-forward regexp nil). Sorry. Here’s the corrected version: --- comint.el.orig 2021-01-17 21:35:02.000000000 -0800 +++ comint.el 2021-01-17 21:36:23.000000000 -0800 @@ -3822,7 +3822,7 @@ Return a list of expressions in the output which match REGEXP. REGEXP-GROUP is the regular _expression_ group in REGEXP to use." (let ((output-buffer " *Comint Redirect Work Buffer*") - results) + results last-point) (with-current-buffer (get-buffer-create output-buffer) (erase-buffer) (comint-redirect-send-command-to-process command @@ -3837,13 +3837,18 @@ ;; Skip past the command, if it was echoed (and (looking-at command) (forward-line)) + (setq last-point (point)) (while (and (not (eobp)) (re-search-forward regexp nil t)) - (push (buffer-substring-no-properties - (match-beginning regexp-group) - (match-end regexp-group)) - results)) + (if (equal (point) last-point) + (forward-line 1) + (push (buffer-substring-no-properties + (match-beginning regexp-group) + (match-end regexp-group)) + results)) + (setq last-point (point))) (nreverse results)))) + ;; Converting process modes to use comint mode ;; ===========================================================================
|
[Prev in Thread] | Current Thread | [Next in Thread] |