浏览代码

org-compat: Provide compatibility definition for font-lock-ensure

* lisp/org-compat.el: Provide compatibility definition for
  `font-lock-ensure' falling back to `font-lock-fontify-buffer' via an
  alias.

This fallback fixes f36b19eef6.  Using a simple alias means we can't
use the optional arguments for `font-lock-ensure' or would have to
provide a macro if we ever want to use them.
Achim Gratz 11 年之前
父节点
当前提交
e6883dd03d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lisp/org-compat.el

+ 4 - 0
lisp/org-compat.el

@@ -422,6 +422,10 @@ TIME defaults to the current time."
 (unless (fboundp 'user-error)
 (unless (fboundp 'user-error)
   (defalias 'user-error '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)
 (defmacro org-no-popups (&rest body)
   "Suppress popup windows.
   "Suppress popup windows.
 Let-bind some variables to nil around BODY to achieve the desired
 Let-bind some variables to nil around BODY to achieve the desired