[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e84b732cbc 2/2: comint-fontify-input: Don't fontify output as inp
From: |
Lars Ingebrigtsen |
Subject: |
master e84b732cbc 2/2: comint-fontify-input: Don't fontify output as input, different approach |
Date: |
Fri, 7 Oct 2022 07:44:28 -0400 (EDT) |
branch: master
commit e84b732cbc54d5ba66e0b6f824edccb2bcb18668
Author: Miha Rihtaršič <miha@kamnitnik.top>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
comint-fontify-input: Don't fontify output as input, different approach
* 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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/comint.el b/lisp/comint.el
index e3eee8411c..07ced8d321 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -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.