summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-02-23 02:36:54 +0200
committerJuri Linkov <juri@linkov.net>2020-02-23 02:36:54 +0200
commitbce17355ac9f6a6f8ed778bd310f3baaea514270 (patch)
treeb1b5038ccc428087225018c91111c8c1948fc5b7 /lisp/font-lock.el
parentc87a165040864919ae5ae23b97935300fa4ad119 (diff)
downloademacs-bce17355ac9f6a6f8ed778bd310f3baaea514270.tar.gz
* lisp/font-lock.el (font-lock-ensure): Use font-lock-specified-p (bug#39597)
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 506c888ff64..e0955b74abc 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1120,9 +1120,10 @@ locking for a mode, and is not meant to be called from lisp functions."
"Make sure the region BEG...END has been fontified.
If the region is not specified, it defaults to the entire accessible
portion of the buffer."
- (font-lock-set-defaults)
- (funcall font-lock-ensure-function
- (or beg (point-min)) (or end (point-max))))
+ (when (font-lock-specified-p t)
+ (font-lock-set-defaults)
+ (funcall font-lock-ensure-function
+ (or beg (point-min)) (or end (point-max)))))
(defun font-lock-default-fontify-buffer ()
"Fontify the whole buffer using `font-lock-fontify-region-function'."