diff options
| author | Chong Yidong | 2012-02-19 21:59:42 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-02-19 21:59:42 +0800 |
| commit | 0fd40f8951f1aaa387e78999ecfbf6bc954ccf8a (patch) | |
| tree | 48386211397064dd0eb1bc47fb0a292e3ad4e19f /lisp/comint.el | |
| parent | 2375c96a71874756c132de1d0508a224c0fea0ab (diff) | |
| download | emacs-0fd40f8951f1aaa387e78999ecfbf6bc954ccf8a.tar.gz emacs-0fd40f8951f1aaa387e78999ecfbf6bc954ccf8a.zip | |
Use text properties for color escape highlighting in Shell mode.
* ansi-color.el: Don't set comint-output-filter-functions; it is
now in the initial value defined in comint.el.
(ansi-color-apply-face-function): New variable.
(ansi-color-apply-on-region): Use it.
(ansi-color-apply-overlay-face): New function.
* comint.el: Require ansi-color.
(comint-output-filter-functions): Add ansi-color-process-output.
* shell.el (shell): No need to require ansi-color.
(shell-mode): Use ansi-color-apply-face-function to highlight
color escapes using font-lock-face property.
Fixes: debbugs:10835
Diffstat (limited to 'lisp/comint.el')
| -rw-r--r-- | lisp/comint.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 975291471df..4c2229f2f83 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -103,6 +103,7 @@ | |||
| 103 | 103 | ||
| 104 | (eval-when-compile (require 'cl)) | 104 | (eval-when-compile (require 'cl)) |
| 105 | (require 'ring) | 105 | (require 'ring) |
| 106 | (require 'ansi-color) | ||
| 106 | 107 | ||
| 107 | ;; Buffer Local Variables: | 108 | ;; Buffer Local Variables: |
| 108 | ;;============================================================================ | 109 | ;;============================================================================ |
| @@ -385,7 +386,7 @@ history list. Default is to save anything that isn't all whitespace.") | |||
| 385 | These functions get one argument, a string containing the text to send.") | 386 | These functions get one argument, a string containing the text to send.") |
| 386 | 387 | ||
| 387 | ;;;###autoload | 388 | ;;;###autoload |
| 388 | (defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) | 389 | (defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) |
| 389 | "Functions to call after output is inserted into the buffer. | 390 | "Functions to call after output is inserted into the buffer. |
| 390 | One possible function is `comint-postoutput-scroll-to-bottom'. | 391 | One possible function is `comint-postoutput-scroll-to-bottom'. |
| 391 | These functions get one argument, a string containing the text as originally | 392 | These functions get one argument, a string containing the text as originally |