From c115c7b4e86b68fe4f903636252a8b22b46a044f Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 26 Jul 2015 23:29:14 -0400 Subject: [PATCH] org-compat: Use different font-lock-ensure alias * lisp/org-compat.el (org-font-lock-ensure): Remove in favor of font-lock-ensure alias from dcbaebc. Instead of org-font-lock-ensure alias introduced in dcbaebc ("Backport commit 6711a21 from Emacs master branch", 2014-05-28), use font-lock-ensure alias added in e6883dd ("org-compat: Provide compatibility definition for font-lock-ensure", 2014-06-01). --- lisp/org-clock.el | 2 +- lisp/org-compat.el | 9 ++++----- lisp/org-src.el | 2 +- lisp/org.el | 2 +- lisp/ox-html.el | 2 +- lisp/ox-odt.el | 2 +- lisp/ox-org.el | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 5b8243f8d..b239e848f 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1929,7 +1929,7 @@ fontified, and then returned." (org-mode) (org-create-dblock props) (org-update-dblock) - (org-font-lock-ensure) + (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 be1141d1f..77366b3db 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -418,6 +418,10 @@ Pass BUFFER to the XEmacs version of `move-to-column'." (unless (fboundp 'user-error) (defalias 'user-error 'error)) +;; `font-lock-ensure' is only available from 24.4.50 on +(unless (fboundp 'font-lock-ensure) + (defalias 'font-lock-ensure 'font-lock-fontify-buffer)) + (defmacro org-no-popups (&rest body) "Suppress popup windows. Let-bind some variables to nil around BODY to achieve the desired @@ -474,11 +478,6 @@ LIMIT." (looking-at (concat "\\(?:" regexp "\\)\\'"))))) (not (null pos))))) -(defalias 'org-font-lock-ensure - (if (fboundp 'org-font-lock-ensure) - #'font-lock-ensure - (lambda (_beg _end) (font-lock-fontify-buffer)))) - (defun org-floor* (x &optional y) "Return a list of the floor of X and the fractional part of X. With two arguments, return floor and remainder of their quotient." diff --git a/lisp/org-src.el b/lisp/org-src.el index e31a39a6e..3619e8077 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -921,7 +921,7 @@ fontification of code blocks see `org-src-fontify-block' and (delete-region (point-min) (point-max)) (insert string " ") ;; so there's a final property change (unless (eq major-mode lang-mode) (funcall lang-mode)) - (org-font-lock-ensure) + (font-lock-ensure) (setq pos (point-min)) (while (setq next (next-single-property-change pos 'face)) (put-text-property diff --git a/lisp/org.el b/lisp/org.el index c2a5875f6..9e66b0e96 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6371,7 +6371,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) - (org-font-lock-ensure) + (font-lock-ensure) (buffer-string)))) (defvar org-m nil) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index c952a826d..29593878c 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1855,7 +1855,7 @@ is the language used for CODE, as a string, or nil." (funcall lang-mode) (insert code) ;; Fontify buffer. - (org-font-lock-ensure) + (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 4ccef1ad7..941fa5333 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -3139,7 +3139,7 @@ and prefix with \"OrgSrc\". For example, (with-temp-buffer (insert code) (funcall lang-mode) - (org-font-lock-ensure) + (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 4bee45ab0..a9b197249 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -254,7 +254,7 @@ Return output file name." (work-buffer (or visitingp (find-file-noselect filename))) newbuf) (with-current-buffer work-buffer - (org-font-lock-ensure) + (font-lock-ensure) (show-all) (org-show-block-all) (setq newbuf (htmlize-buffer)))