org-src: Use font-lock-fontify-buffer for blocks

* lisp/org-src.el (org-src-font-lock-fontify-block): Use
  font-lock-fontify-buffer because font-lock-ensure does not display
  source block fonts.

When font-lock-fontify-buffer was originally replaced by
font-lock-ensure, source block fonts were not being displayed, so
99f9999 reverted this change.  However, a backport (d81e6b5) from the
Emacs repo, which was merged to master in 0d0d0ad, reverted this again.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99495>
This commit is contained in:
Kyle Meyer 2015-08-04 23:50:59 -04:00
parent ff92583e42
commit 003a0f1069

View file

@ -497,7 +497,9 @@ as `org-src-fontify-natively' is non-nil."
(delete-region (point-min) (point-max))
(insert string " ") ;; so there's a final property change
(unless (eq major-mode lang-mode) (funcall lang-mode))
(font-lock-ensure)
;; Avoid `font-lock-ensure', which does not display fonts in
;; source block.
(font-lock-fontify-buffer)
(setq pos (point-min))
(while (setq next (next-single-property-change pos 'face))
(put-text-property