diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b5b10eb28..143f7495c 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2031,7 +2031,7 @@ fontified, and then returned." (org-mode) (org-create-dblock props) (org-update-dblock) - (font-lock-ensure) + (org-font-lock-ensure) (forward-line 2) (buffer-substring (point) (progn (re-search-forward "^[ \t]*#\\+END" nil t) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 78bdba848..0ccb99bd5 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -409,8 +409,10 @@ Pass BUFFER to the XEmacs version of `move-to-column'." (defalias 'format-message 'format)) ;; `font-lock-ensure' is only available from 24.4.50 on -(unless (fboundp 'font-lock-ensure) - (defalias 'font-lock-ensure 'font-lock-fontify-buffer)) +(defalias 'org-font-lock-ensure + (if (fboundp 'font-lock-ensure) + #'font-lock-ensure + (lambda (&optional _beg _end) (font-lock-fontify-buffer)))) (defmacro org-no-popups (&rest body) "Suppress popup windows. diff --git a/lisp/org.el b/lisp/org.el index 574249156..fd08292e0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6497,7 +6497,7 @@ needs to be inserted at a specific position in the font-lock sequence.") (insert s) (let ((org-odd-levels-only odd-levels)) (org-mode) - (font-lock-ensure) + (org-font-lock-ensure) (buffer-string)))) (defvar org-m nil) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 058804368..b3357ada4 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2047,7 +2047,7 @@ is the language used for CODE, as a string, or nil." (funcall lang-mode) (insert code) ;; Fontify buffer. - (font-lock-ensure) + (org-font-lock-ensure) ;; Remove formatting on newline characters. (save-excursion (let ((beg (point-min)) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index e89a3077c..31b06de91 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -3167,7 +3167,7 @@ and prefix with \"OrgSrc\". For example, (with-temp-buffer (insert code) (funcall lang-mode) - (font-lock-ensure) + (org-font-lock-ensure) (buffer-string)))) (fontifier (if use-htmlfontify-p 'org-odt-htmlfontify-string 'org-odt--encode-plain-text)) diff --git a/lisp/ox-org.el b/lisp/ox-org.el index 020a61f15..d9af3f7af 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -297,7 +297,7 @@ Return output file name." (work-buffer (or visitingp (find-file-noselect filename))) newbuf) (with-current-buffer work-buffer - (font-lock-ensure) + (org-font-lock-ensure) (outline-show-all) (org-show-block-all) (setq newbuf (htmlize-buffer)))