]> git.eshelyaron.com Git - emacs.git/commitdiff
comint-fontify-input: Don't fontify output as input, different approach
authorMiha Rihtaršič <miha@kamnitnik.top>
Thu, 6 Oct 2022 18:22:39 +0000 (20:22 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 7 Oct 2022 11:44:21 +0000 (13:44 +0200)
* lisp/comint.el (comint-output-filter): Propertize process output
with field=output before inserting it into buffer to prevent
comint-fontify-input from fontifying it (bug#58169).

lisp/comint.el

index e3eee8411c7ecdd4cc93e15e5d2b015a142c3f13..07ced8d321a39d879b90f4c21e25656d9e5df25e 100644 (file)
@@ -2147,6 +2147,12 @@ Make backspaces delete the previous character."
            (goto-char (process-mark process))
            (set-marker comint-last-output-start (point))
 
+            ;; Before we call `comint--mark-as-output' later,
+            ;; redisplay can be called.  We mark the inserted text as
+            ;; output early, to prevent redisplay from fontifying it
+            ;; as input in case of `comint-fontify-input-mode'.
+            (put-text-property 0 (length string) 'field 'output 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.