diff options
| author | Noam Postavsky | 2017-03-21 09:03:47 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-03-21 09:19:57 -0400 |
| commit | d38fd9229c07c531ebc0bec0ea65f7d7dffcd983 (patch) | |
| tree | c8e9b342d335579ef5d15172ca4d68356012c375 | |
| parent | e0e9db4c84ab44fc852d3901c1c9ae20816bd704 (diff) | |
| download | emacs-d38fd9229c07c531ebc0bec0ea65f7d7dffcd983.tar.gz emacs-d38fd9229c07c531ebc0bec0ea65f7d7dffcd983.zip | |
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.
| -rw-r--r-- | lisp/org/org-src.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index a02402cf60e..16aa443232f 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 | |||
| 918 | ;; from `jit-lock-function' (Bug#25132). | 918 | ;; from `jit-lock-function' (Bug#25132). |
| 919 | (let ((inhibit-modification-hooks nil)) | 919 | (let ((inhibit-modification-hooks nil)) |
| 920 | (delete-region (point-min) (point-max)) | 920 | (delete-region (point-min) (point-max)) |
| 921 | (insert string " ") ;; so there's a final property change | 921 | (insert string " ")) ;; so there's a final property change |
| 922 | (unless (eq major-mode lang-mode) (funcall lang-mode)) | 922 | (unless (eq major-mode lang-mode) (funcall lang-mode)) |
| 923 | (org-font-lock-ensure) | 923 | (org-font-lock-ensure) |
| 924 | (setq pos (point-min)) | 924 | (setq pos (point-min)) |
| 925 | (while (setq next (next-single-property-change pos 'face)) | 925 | (while (setq next (next-single-property-change pos 'face)) |
| 926 | (put-text-property | 926 | (put-text-property |
| 927 | (+ start (1- pos)) (1- (+ start next)) 'face | 927 | (+ start (1- pos)) (1- (+ start next)) 'face |
| 928 | (get-text-property pos 'face) org-buffer) | 928 | (get-text-property pos 'face) org-buffer) |
| 929 | (setq pos next)))) | 929 | (setq pos next))) |
| 930 | (add-text-properties | 930 | (add-text-properties |
| 931 | start end | 931 | start end |
| 932 | '(font-lock-fontified t fontified t font-lock-multiline t)) | 932 | '(font-lock-fontified t fontified t font-lock-multiline t)) |