emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 d38fd92: Narrow scope of modification hook renabl


From: Noam Postavsky
Subject: [Emacs-diffs] emacs-25 d38fd92: Narrow scope of modification hook renabling in org-src fontification
Date: Tue, 21 Mar 2017 09:22:36 -0400 (EDT)

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

    Narrow scope of modification hook renabling in org-src fontification
    
    Modification hooks should be enabled while modifying text in the
    org-src temp buffer, but in 2017-01-29 "Call modification hooks in
    org-src fontify buffers" the hooks were enabled also for modifications
    to the original org buffer.  This causes fontification errors when
    combined with certain packages, as reported in
    http://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00420.html.
    
    * lisp/org/org-src.el (org-src-font-lock-fontify-block): Reduce scope
    of inhibit-modification-hooks let-binding.
---
 lisp/org/org-src.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index a02402c..16aa443 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -918,15 +918,15 @@ fontification of code blocks see `org-src-fontify-block' 
and
             ;; 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))))
+              (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]