aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-03-11 03:50:50 +0000
committerStefan Monnier2000-03-11 03:50:50 +0000
commitafa18a4e5d28a418fa9374c96be75a8e20f5fe08 (patch)
treeecf2a5f2178c84cf4dfa6e3a2472d4bdcf80dc9b
parente4ad5f9e5f7b0b98399c7912ce41eb362fde5c11 (diff)
downloademacs-afa18a4e5d28a418fa9374c96be75a8e20f5fe08.tar.gz
emacs-afa18a4e5d28a418fa9374c96be75a8e20f5fe08.zip
(font-lock-keywords): Fix the doc now that regexp-opt-depth is unnecessary.
(save-buffer-state): Set an edebug spec. (font-lock-fontify-anchored-keywords): Properly handle the case where the matcher goes past the limit.
-rw-r--r--lisp/font-lock.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 1229a3e3cff..91775206f3a 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -119,7 +119,7 @@
119;; 119;;
120;; Efficient regexps for use as MATCHERs for `font-lock-keywords' and 120;; Efficient regexps for use as MATCHERs for `font-lock-keywords' and
121;; `font-lock-syntactic-keywords' can be generated via the function 121;; `font-lock-syntactic-keywords' can be generated via the function
122;; `regexp-opt', and their depth counted via the function `regexp-opt-depth'. 122;; `regexp-opt'.
123 123
124;;; Adding patterns for modes that already support Font Lock: 124;;; Adding patterns for modes that already support Font Lock:
125 125
@@ -332,10 +332,10 @@ MATCH-HIGHLIGHT should be of the form:
332where MATCHER can be either the regexp to search for, or the function name to 332where MATCHER can be either the regexp to search for, or the function name to
333call to make the search (called with one argument, the limit of the search) and 333call to make the search (called with one argument, the limit of the search) and
334return non-nil if it succeeds (and set `match-data' appropriately). 334return non-nil if it succeeds (and set `match-data' appropriately).
335MATCHER regexps can be generated via the function `regexp-opt'. MATCH is the 335MATCHER regexps can be generated via the function `regexp-opt'. MATCH is
336subexpression of MATCHER to be highlighted. MATCH can be calculated via the 336the subexpression of MATCHER to be highlighted. FACENAME is an expression
337function `regexp-opt-depth'. FACENAME is an expression whose value is the face 337whose value is the face name to use. Face default attributes can be
338name to use. Face default attributes can be modified via \\[customize]. 338modified via \\[customize].
339 339
340OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can 340OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can
341be overwritten. If `keep', only parts not already fontified are highlighted. 341be overwritten. If `keep', only parts not already fontified are highlighted.
@@ -638,6 +638,7 @@ Major/minor modes can set this variable if they know which option applies.")
638 (when (and (not modified) (buffer-modified-p)) 638 (when (and (not modified) (buffer-modified-p))
639 (set-buffer-modified-p nil))))) 639 (set-buffer-modified-p nil)))))
640 (put 'save-buffer-state 'lisp-indent-function 1) 640 (put 'save-buffer-state 'lisp-indent-function 1)
641 (def-edebug-spec save-buffer-state let)
641 ;; 642 ;;
642 ;; Shut up the byte compiler. 643 ;; Shut up the byte compiler.
643 (defvar global-font-lock-mode) ; Now a defcustom. 644 (defvar global-font-lock-mode) ; Now a defcustom.
@@ -1577,9 +1578,10 @@ LIMIT can be modified by the value of its PRE-MATCH-FORM."
1577 (put-text-property (point) limit 'font-lock-multiline t))) 1578 (put-text-property (point) limit 'font-lock-multiline t)))
1578 (save-match-data 1579 (save-match-data
1579 ;; Find an occurrence of `matcher' before `limit'. 1580 ;; Find an occurrence of `matcher' before `limit'.
1580 (while (if (stringp matcher) 1581 (while (and (< (point) limit)
1581 (re-search-forward matcher limit t) 1582 (if (stringp matcher)
1582 (funcall matcher limit)) 1583 (re-search-forward matcher limit t)
1584 (funcall matcher limit)))
1583 ;; Apply each highlight to this instance of `matcher'. 1585 ;; Apply each highlight to this instance of `matcher'.
1584 (setq highlights lowdarks) 1586 (setq highlights lowdarks)
1585 (while highlights 1587 (while highlights