diff options
| author | Stefan Monnier | 2000-03-11 03:50:50 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-03-11 03:50:50 +0000 |
| commit | afa18a4e5d28a418fa9374c96be75a8e20f5fe08 (patch) | |
| tree | ecf2a5f2178c84cf4dfa6e3a2472d4bdcf80dc9b | |
| parent | e4ad5f9e5f7b0b98399c7912ce41eb362fde5c11 (diff) | |
| download | emacs-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.el | 18 |
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: | |||
| 332 | where MATCHER can be either the regexp to search for, or the function name to | 332 | where MATCHER can be either the regexp to search for, or the function name to |
| 333 | call to make the search (called with one argument, the limit of the search) and | 333 | call to make the search (called with one argument, the limit of the search) and |
| 334 | return non-nil if it succeeds (and set `match-data' appropriately). | 334 | return non-nil if it succeeds (and set `match-data' appropriately). |
| 335 | MATCHER regexps can be generated via the function `regexp-opt'. MATCH is the | 335 | MATCHER regexps can be generated via the function `regexp-opt'. MATCH is |
| 336 | subexpression of MATCHER to be highlighted. MATCH can be calculated via the | 336 | the subexpression of MATCHER to be highlighted. FACENAME is an expression |
| 337 | function `regexp-opt-depth'. FACENAME is an expression whose value is the face | 337 | whose value is the face name to use. Face default attributes can be |
| 338 | name to use. Face default attributes can be modified via \\[customize]. | 338 | modified via \\[customize]. |
| 339 | 339 | ||
| 340 | OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can | 340 | OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can |
| 341 | be overwritten. If `keep', only parts not already fontified are highlighted. | 341 | be 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 |