]> git.eshelyaron.com Git - emacs.git/commitdiff
Let ansi-color overlay hooks work in eshell (Bug#27407)
authorNoam Postavsky <npostavs@gmail.com>
Sat, 17 Jun 2017 16:06:37 +0000 (12:06 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Mon, 3 Jul 2017 14:09:40 +0000 (10:09 -0400)
* lisp/ansi-color.el (ansi-color-make-extent): Add
`ansi-color-freeze-overlay' to `insert-behind-hooks' as well.
* lisp/eshell/esh-mode.el (eshell-output-filter): Let-bind
`inhibit-modification-hooks' to nil while inserting the string.

lisp/ansi-color.el
lisp/eshell/esh-mode.el

index a1b493317547dd84216887905dea84aaf2587d33..72d70c2102e879979da07967ceeb19cd85ad8b74 100644 (file)
@@ -481,6 +481,7 @@ Emacs requires OBJECT to be a buffer."
     ;; property to make sure it works.
     (let ((overlay (make-overlay from to object)))
       (overlay-put overlay 'modification-hooks '(ansi-color-freeze-overlay))
+      (overlay-put overlay 'insert-behind-hooks '(ansi-color-freeze-overlay))
       overlay)))
 
 (defun ansi-color-freeze-overlay (overlay is-after begin end &optional len)
index 0fd0c183016848e6f1977be1953ef78ad2fb8a83..0999f9c4a88e817e954f865c0cff27d8dd32c6a6 100644 (file)
@@ -726,7 +726,9 @@ This is done after all necessary filtering has been done."
                  (setq obeg (+ obeg nchars)))
              (if (<= (point) oend)
                  (setq oend (+ oend nchars)))
-             (insert-before-markers string)
+              ;; Let the ansi-color overlay hooks run.
+              (let ((inhibit-modification-hooks nil))
+                (insert-before-markers string))
              (if (= (window-start) (point))
                  (set-window-start (selected-window)
                                    (- (point) nchars)))