diff options
| author | Noam Postavsky | 2017-01-07 16:05:19 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-01-29 11:01:32 -0500 |
| commit | ae8264c5cccf19d5b25a340a605bf2f07de1577e (patch) | |
| tree | 03dc5ed1c5cf1d71e2caca2f5163f11f48963c30 | |
| parent | b3139da0778739b88e17aa9d980e6025b811f928 (diff) | |
| download | emacs-ae8264c5cccf19d5b25a340a605bf2f07de1577e.tar.gz emacs-ae8264c5cccf19d5b25a340a605bf2f07de1577e.zip | |
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).
| -rw-r--r-- | lisp/org/org-src.el | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index d01f1082f9f..a02402cf60e 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 | |||
| 913 | (with-current-buffer | 913 | (with-current-buffer |
| 914 | (get-buffer-create | 914 | (get-buffer-create |
| 915 | (concat " org-src-fontification:" (symbol-name lang-mode))) | 915 | (concat " org-src-fontification:" (symbol-name lang-mode))) |
| 916 | (delete-region (point-min) (point-max)) | 916 | ;; Make sure that modification hooks are not inhibited in |
| 917 | (insert string " ") ;; so there's a final property change | 917 | ;; the org-src-fontification buffer in case we're called |
| 918 | (unless (eq major-mode lang-mode) (funcall lang-mode)) | 918 | ;; from `jit-lock-function' (Bug#25132). |
| 919 | (org-font-lock-ensure) | 919 | (let ((inhibit-modification-hooks nil)) |
| 920 | (setq pos (point-min)) | 920 | (delete-region (point-min) (point-max)) |
| 921 | (while (setq next (next-single-property-change pos 'face)) | 921 | (insert string " ") ;; so there's a final property change |
| 922 | (put-text-property | 922 | (unless (eq major-mode lang-mode) (funcall lang-mode)) |
| 923 | (+ start (1- pos)) (1- (+ start next)) 'face | 923 | (org-font-lock-ensure) |
| 924 | (get-text-property pos 'face) org-buffer) | 924 | (setq pos (point-min)) |
| 925 | (setq pos next))) | 925 | (while (setq next (next-single-property-change pos 'face)) |
| 926 | (put-text-property | ||
| 927 | (+ start (1- pos)) (1- (+ start next)) 'face | ||
| 928 | (get-text-property pos 'face) org-buffer) | ||
| 929 | (setq pos next)))) | ||
| 926 | (add-text-properties | 930 | (add-text-properties |
| 927 | start end | 931 | start end |
| 928 | '(font-lock-fontified t fontified t font-lock-multiline t)) | 932 | '(font-lock-fontified t fontified t font-lock-multiline t)) |