diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2018-12-18 23:26:49 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2018-12-18 23:26:49 -0500 |
commit | 70926a3e8671034fd5cb1a546f9c107feda729a3 (patch) | |
tree | f38a3b3166b33197f3f7ae0573f44c0284788b19 /lisp/font-lock.el | |
parent | bb55d384cdb19a7af0da0c3cdd00ca6967ddd1a9 (diff) | |
download | emacs-70926a3e8671034fd5cb1a546f9c107feda729a3.tar.gz |
* lisp/font-lock.el: Use lexical-binding
(font-lock-initial-fontify, font-lock-compile-keywords):
Silence compiler warning.
(font-lock-ensure-function): Fix some problems in last commit.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f50a7150aad..ee4b78b590e 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1,4 +1,4 @@ -;;; font-lock.el --- Electric font lock mode +;;; font-lock.el --- Electric font lock mode -*- lexical-binding:t -*- ;; Copyright (C) 1992-2018 Free Software Foundation, Inc. @@ -656,7 +656,7 @@ be enabled." (cond (font-lock-fontified nil) ((or (null max-size) (> max-size (buffer-size))) - (font-lock-fontify-buffer)) + (with-no-warnings (font-lock-fontify-buffer))) (font-lock-verbose (message "Fontifying %s...buffer size greater than font-lock-maximum-size" (buffer-name))))))) @@ -1095,7 +1095,8 @@ accessible portion of the current buffer." (defvar font-lock-ensure-function (lambda (beg end) (unless font-lock-fontified - (font-lock-fontify-region beg end))) + (save-excursion + (font-lock-fontify-region (or beg (point-min)) (or end (point-max)))))) "Function to make sure a region has been fontified. Called with two arguments BEG and END.") @@ -1779,7 +1780,7 @@ If SYNTACTIC-KEYWORDS is non-nil, it means these keywords are used for (cons t (cons keywords (mapcar #'font-lock-compile-keyword keywords)))) (if (and (not syntactic-keywords) - (let ((beg-function syntax-begin-function)) + (let ((beg-function (with-no-warnings syntax-begin-function))) (or (eq beg-function #'beginning-of-defun) (if (symbolp beg-function) (get beg-function 'font-lock-syntax-paren-check)))) |