summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-05-04 14:47:29 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-05-04 15:33:20 -0400
commit4fd9048e940d38364caf4abe9b209f9288c78544 (patch)
treea89d315f7671b1369c90bb3b7c503ca78193ea3f /lisp/eshell
parent37963ed4991823fd1ee5cd2c485f22ac988259e2 (diff)
downloademacs-4fd9048e940d38364caf4abe9b209f9288c78544.tar.gz
Avoid slow overlay ansi coloring in eshell (Bug#29854)
* lisp/ansi-color.el (ansi-color-apply-on-region): Reset temporary markers after finishing with them. (ansi-color-apply-text-property-face): New function. * lisp/eshell/esh-mode.el (eshell-handle-ansi-color): * lisp/man.el (Man-fontify-manpage): Use it as the `ansi-color-apply-face-function' while calling `ansi-color-apply-on-region'. Use `font-lock-face' to propertize instead of `face'.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-mode.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index cff29bed1b6..a36ac969e55 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -1014,11 +1014,13 @@ This function could be in the list `eshell-output-filter-functions'."
'eshell-handle-control-codes)
(autoload 'ansi-color-apply-on-region "ansi-color")
+(defvar ansi-color-apply-face-function)
(defun eshell-handle-ansi-color ()
"Handle ANSI color codes."
- (ansi-color-apply-on-region eshell-last-output-start
- eshell-last-output-end))
+ (let ((ansi-color-apply-face-function #'ansi-color-apply-text-property-face))
+ (ansi-color-apply-on-region eshell-last-output-start
+ eshell-last-output-end)))
(custom-add-option 'eshell-output-filter-functions
'eshell-handle-ansi-color)