summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-09-01 21:39:38 -0700
committerDan Davison <davison@stats.ox.ac.uk>2010-09-02 08:13:13 -0700
commitabfc2cc30ebc74a03d90437ba1bf48c297b249d4 (patch)
tree4032b9f60bf648eb90152bffaac0923de306949d
parent73957b8fbfa8d0ed12f6548662eb46f28a88ea65 (diff)
downloadorg-mode-abfc2cc30ebc74a03d90437ba1bf48c297b249d4.tar.gz
Re-use hidden language major mode buffers during code fontification
* org-src.el (org-src-font-lock-fontify-block): Re-use hidden language major mode buffers during fontification
-rw-r--r--lisp/org-src.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index ace2714..6c09cbd 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -726,9 +726,12 @@ fontification of code blocks see `org-src-fontify-block' and
(modified (buffer-modified-p))
(org-buffer (current-buffer)) pos next)
(remove-text-properties start end '(face nil))
- (with-temp-buffer
+ (with-current-buffer
+ (get-buffer-create
+ (concat " org-src-fontification:" (symbol-name lang-mode)))
+ (delete-region (point-min) (point-max))
(insert string)
- (funcall lang-mode)
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
(font-lock-fontify-buffer)
(setq pos (point-min))
(while (setq next (next-single-property-change pos 'face))