bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#50207: 28.0.50; ansi-color-compilation-filter and rgrep


From: Juri Linkov
Subject: bug#50207: 28.0.50; ansi-color-compilation-filter and rgrep
Date: Thu, 15 Dec 2022 10:02:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> Have you tried to replace a number with a marker?  Does it help to fix
>> this bug?
>
> I've tried this and, although I think it's sane and should be done
> anyway, it didn't solve this bug in particular.

Does this patch solve the bug?

```
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index 5e7015db549..d7508759702 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -688,6 +688,7 @@ ansi-color-filter-region
          (start (cadr context)))
     (save-excursion
       (goto-char start)
+      (forward-line 0)
       ;; Delete escape sequences.
       (while (re-search-forward ansi-color-control-seq-regexp end-marker t)
         (delete-region (match-beginning 0) (match-end 0)))
@@ -727,6 +728,7 @@ ansi-color-apply-on-region
          (end-marker (copy-marker end)))
     (save-excursion
       (goto-char start-marker)
+      (forward-line 0)
       ;; Find the next escape sequence.
       (while (re-search-forward ansi-color-control-seq-regexp end-marker t)
         ;; Extract escape sequence.
```





reply via email to

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