emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 ae8264c: Call modification hooks in org-src fonti


From: Noam Postavsky
Subject: [Emacs-diffs] emacs-25 ae8264c: Call modification hooks in org-src fontify buffers
Date: Sun, 29 Jan 2017 16:00:35 +0000 (UTC)

branch: emacs-25
commit ae8264c5cccf19d5b25a340a605bf2f07de1577e
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Call modification hooks in org-src fontify buffers
    
    * lisp/org/org-src.el (org-src-font-lock-fontify-block): Let-bind
    `inhibit-modification-hooks' to nil, since this function can be called
    from jit-lock-function which binds that variable to t (Bug#25132).
---
 lisp/org/org-src.el |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index d01f108..a02402c 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -913,16 +913,20 @@ fontification of code blocks see `org-src-fontify-block' 
and
          (with-current-buffer
              (get-buffer-create
               (concat " org-src-fontification:" (symbol-name lang-mode)))
-           (delete-region (point-min) (point-max))
-           (insert string " ") ;; so there's a final property change
-           (unless (eq major-mode lang-mode) (funcall lang-mode))
-            (org-font-lock-ensure)
-           (setq pos (point-min))
-           (while (setq next (next-single-property-change pos 'face))
-             (put-text-property
-              (+ start (1- pos)) (1- (+ start next)) 'face
-              (get-text-property pos 'face) org-buffer)
-             (setq pos next)))
+            ;; Make sure that modification hooks are not inhibited in
+            ;; the org-src-fontification buffer in case we're called
+            ;; from `jit-lock-function' (Bug#25132).
+            (let ((inhibit-modification-hooks nil))
+              (delete-region (point-min) (point-max))
+              (insert string " ") ;; so there's a final property change
+              (unless (eq major-mode lang-mode) (funcall lang-mode))
+              (org-font-lock-ensure)
+              (setq pos (point-min))
+              (while (setq next (next-single-property-change pos 'face))
+                (put-text-property
+                 (+ start (1- pos)) (1- (+ start next)) 'face
+                 (get-text-property pos 'face) org-buffer)
+                (setq pos next))))
          (add-text-properties
           start end
           '(font-lock-fontified t fontified t font-lock-multiline t))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]