diff options
| author | Miha Rihtaršič | 2022-09-30 20:07:03 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-09-30 21:15:06 +0200 |
| commit | 90744ff0be581b69cedea1194b7e78265bdb67a4 (patch) | |
| tree | 0d60514a651f5d143991b99c40f026dbc1241d98 | |
| parent | 22f0e777f3e91a9ad51bc901646804f629832c64 (diff) | |
| download | emacs-90744ff0be581b69cedea1194b7e78265bdb67a4.tar.gz emacs-90744ff0be581b69cedea1194b7e78265bdb67a4.zip | |
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).
| -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." | |||
| 2150 | ;; insert-before-markers is a bad thing. XXX | 2150 | ;; insert-before-markers is a bad thing. XXX |
| 2151 | ;; Luckily we don't have to use it any more, we use | 2151 | ;; Luckily we don't have to use it any more, we use |
| 2152 | ;; window-point-insertion-type instead. | 2152 | ;; window-point-insertion-type instead. |
| 2153 | (insert string) | 2153 | (make-local-variable 'jit-lock-mode) |
| 2154 | (let ((jit-lock-mode nil)) | ||
| 2155 | (insert string) | ||
| 2154 | 2156 | ||
| 2155 | ;; Advance process-mark | 2157 | ;; Advance process-mark |
| 2156 | (set-marker (process-mark process) (point)) | 2158 | (set-marker (process-mark process) (point)) |
| 2157 | 2159 | ||
| 2158 | (unless comint-inhibit-carriage-motion | 2160 | (unless comint-inhibit-carriage-motion |
| 2159 | ;; Interpret any carriage motion characters (newline, backspace) | 2161 | ;; Interpret any carriage motion characters (newline, backspace) |
| 2160 | (comint-carriage-motion comint-last-output-start (point))) | 2162 | (comint-carriage-motion comint-last-output-start (point))) |
| 2161 | 2163 | ||
| 2162 | ;; Run these hooks with point where the user had it. | 2164 | ;; Run these hooks with point where the user had it. |
| 2163 | (goto-char saved-point) | 2165 | (goto-char saved-point) |
| 2164 | (run-hook-with-args 'comint-output-filter-functions string) | 2166 | (run-hook-with-args 'comint-output-filter-functions string) |
| 2165 | (set-marker saved-point (point)) | 2167 | (set-marker saved-point (point)) |
| 2166 | 2168 | ||
| 2167 | (goto-char (process-mark process)) ; In case a filter moved it. | 2169 | (goto-char (process-mark process)) ; In case a filter moved it. |
| 2168 | 2170 | ||
| 2169 | (unless comint-use-prompt-regexp | 2171 | (unless comint-use-prompt-regexp |
| 2170 | (comint--mark-as-output comint-last-output-start (point))) | 2172 | (comint--mark-as-output comint-last-output-start (point)))) |
| 2171 | 2173 | ||
| 2172 | ;; Highlight the prompt, where we define `prompt' to mean | 2174 | ;; Highlight the prompt, where we define `prompt' to mean |
| 2173 | ;; the most recent output that doesn't end with a newline. | 2175 | ;; the most recent output that doesn't end with a newline. |