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).
This commit is contained in:
parent
b3139da077
commit
ae8264c5cc
1 changed files with 14 additions and 10 deletions
|
@ -913,6 +913,10 @@ fontification of code blocks see `org-src-fontify-block' and
|
||||||
(with-current-buffer
|
(with-current-buffer
|
||||||
(get-buffer-create
|
(get-buffer-create
|
||||||
(concat " org-src-fontification:" (symbol-name lang-mode)))
|
(concat " org-src-fontification:" (symbol-name lang-mode)))
|
||||||
|
;; 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))
|
(delete-region (point-min) (point-max))
|
||||||
(insert string " ") ;; so there's a final property change
|
(insert string " ") ;; so there's a final property change
|
||||||
(unless (eq major-mode lang-mode) (funcall lang-mode))
|
(unless (eq major-mode lang-mode) (funcall lang-mode))
|
||||||
|
@ -922,7 +926,7 @@ fontification of code blocks see `org-src-fontify-block' and
|
||||||
(put-text-property
|
(put-text-property
|
||||||
(+ start (1- pos)) (1- (+ start next)) 'face
|
(+ start (1- pos)) (1- (+ start next)) 'face
|
||||||
(get-text-property pos 'face) org-buffer)
|
(get-text-property pos 'face) org-buffer)
|
||||||
(setq pos next)))
|
(setq pos next))))
|
||||||
(add-text-properties
|
(add-text-properties
|
||||||
start end
|
start end
|
||||||
'(font-lock-fontified t fontified t font-lock-multiline t))
|
'(font-lock-fontified t fontified t font-lock-multiline t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue