diff options
author | Miha Rihtaršič <miha@kamnitnik.top> | 2022-09-30 20:07:03 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-09-30 21:15:06 +0200 |
commit | 90744ff0be581b69cedea1194b7e78265bdb67a4 (patch) | |
tree | 0d60514a651f5d143991b99c40f026dbc1241d98 /lisp/comint.el | |
parent | 22f0e777f3e91a9ad51bc901646804f629832c64 (diff) | |
download | emacs-90744ff0be581b69cedea1194b7e78265bdb67a4.tar.gz |
comint-fl: Prevent fontification of output as input
* lisp/comint.el (comint-output-filter): Inhibit jit-lock
fontification of inserted process output before marking it with the
'output' filed property (bug#58169).
Diffstat (limited to 'lisp/comint.el')
-rw-r--r-- | lisp/comint.el | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index e7d2136c841..15c9388ea4f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2150,24 +2150,26 @@ Make backspaces delete the previous character." ;; 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. - (insert string) + (make-local-variable 'jit-lock-mode) + (let ((jit-lock-mode nil)) + (insert string) - ;; Advance process-mark - (set-marker (process-mark process) (point)) + ;; Advance process-mark + (set-marker (process-mark process) (point)) - (unless comint-inhibit-carriage-motion + (unless comint-inhibit-carriage-motion ;; Interpret any carriage motion characters (newline, backspace) (comint-carriage-motion comint-last-output-start (point))) - ;; Run these hooks with point where the user had it. - (goto-char saved-point) - (run-hook-with-args 'comint-output-filter-functions string) - (set-marker saved-point (point)) + ;; Run these hooks with point where the user had it. + (goto-char saved-point) + (run-hook-with-args 'comint-output-filter-functions string) + (set-marker saved-point (point)) - (goto-char (process-mark process)) ; In case a filter moved it. + (goto-char (process-mark process)) ; In case a filter moved it. - (unless comint-use-prompt-regexp - (comint--mark-as-output comint-last-output-start (point))) + (unless comint-use-prompt-regexp + (comint--mark-as-output comint-last-output-start (point)))) ;; Highlight the prompt, where we define `prompt' to mean ;; the most recent output that doesn't end with a newline. |