summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-01-07 16:05:19 -0500
committerKyle Meyer <kyle@kyleam.com>2017-01-29 13:16:09 -0500
commitf2a5104e45b6f44a08960ae49ba20c124a8fa9d8 (patch)
tree4d10ef132c0197a770a63e1584a5ddfe9ce7b374
parent39682d4854a6cb6668bec86479f36d1d39f71f09 (diff)
downloadorg-mode-f2a5104e45b6f44a08960ae49ba20c124a8fa9d8.tar.gz
Backport commit ae8264c5cc from Emacs
* lisp/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). Call modification hooks in org-src fontify buffers ae8264c5cccf19d5b25a340a605bf2f07de1577e Noam Postavsky Sun Jan 29 11:01:32 2017 -0500
-rw-r--r--lisp/org-src.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 3fa0337..b45306e 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -522,21 +522,22 @@ as `org-src-fontify-natively' is non-nil."
(with-current-buffer
(get-buffer-create
(format " *org-src-fontification:%s*" lang-mode))
- (erase-buffer)
- ;; Add string and a final space to ensure property change.
- (insert string " ")
- (unless (eq major-mode lang-mode) (funcall lang-mode))
- (org-font-lock-ensure)
- (let ((pos (point-min)) next)
- (while (setq next (next-property-change pos))
- ;; Handle additional properties from font-lock, so as to
- ;; preserve, e.g., composition.
- (dolist (prop (cons 'face font-lock-extra-managed-props))
- (let ((new-prop (get-text-property pos prop)))
- (put-text-property
- (+ start (1- pos)) (1- (+ start next)) prop new-prop
- org-buffer)))
- (setq pos next))))
+ (let ((inhibit-modification-hooks nil))
+ (erase-buffer)
+ ;; Add string and a final space to ensure property change.
+ (insert string " ")
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
+ (org-font-lock-ensure)
+ (let ((pos (point-min)) next)
+ (while (setq next (next-property-change pos))
+ ;; Handle additional properties from font-lock, so as to
+ ;; preserve, e.g., composition.
+ (dolist (prop (cons 'face font-lock-extra-managed-props))
+ (let ((new-prop (get-text-property pos prop)))
+ (put-text-property
+ (+ start (1- pos)) (1- (+ start next)) prop new-prop
+ org-buffer)))
+ (setq pos next)))))
;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
(when (or (facep src-face) (listp src-face))