466 |
optimized.") |
optimized.") |
467 |
|
|
468 |
(defvar font-lock-keywords-alist nil |
(defvar font-lock-keywords-alist nil |
469 |
"*Alist of `font-lock-keywords' local to a `major-mode'. |
"Alist of `font-lock-keywords' local to a `major-mode'. |
470 |
This is normally set via `font-lock-add-keywords' and |
This is normally set via `font-lock-add-keywords' and |
471 |
`font-lock-remove-keywords'.") |
`font-lock-remove-keywords'.") |
472 |
|
|
473 |
(defvar font-lock-removed-keywords-alist nil |
(defvar font-lock-removed-keywords-alist nil |
474 |
"*Alist of `font-lock-keywords' removed from `major-mode'. |
"Alist of `font-lock-keywords' removed from `major-mode'. |
475 |
This is normally set via `font-lock-add-keywords' and |
This is normally set via `font-lock-add-keywords' and |
476 |
`font-lock-remove-keywords'.") |
`font-lock-remove-keywords'.") |
477 |
|
|
664 |
adds two fontification patterns for C mode, to fontify `FIXME:' words, even in |
adds two fontification patterns for C mode, to fontify `FIXME:' words, even in |
665 |
comments, and to fontify `and', `or' and `not' words as keywords. |
comments, and to fontify `and', `or' and `not' words as keywords. |
666 |
|
|
667 |
When used from an elisp package (such as a minor mode), it is recommended |
When used from a Lisp program (such as a minor mode), it is recommended to |
668 |
to use nil for MODE (and place the call in a loop or on a hook) to avoid |
use nil for MODE (and place the call on a hook) to avoid subtle problems |
669 |
subtle problems due to details of the implementation. |
due to details of the implementation. |
670 |
|
|
671 |
Note that some modes have specialized support for additional patterns, e.g., |
Note that some modes have specialized support for additional patterns, e.g., |
672 |
see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', |
see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', |
707 |
(font-lock-compile-keywords font-lock-keywords t))))))) |
(font-lock-compile-keywords font-lock-keywords t))))))) |
708 |
|
|
709 |
(defun font-lock-update-removed-keyword-alist (mode keywords append) |
(defun font-lock-update-removed-keyword-alist (mode keywords append) |
710 |
;; Update `font-lock-removed-keywords-alist' when adding new |
"Update `font-lock-removed-keywords-alist' when adding new KEYWORDS to MODE." |
|
;; KEYWORDS to MODE. |
|
|
;; |
|
711 |
;; When font-lock is enabled first all keywords in the list |
;; When font-lock is enabled first all keywords in the list |
712 |
;; `font-lock-keywords-alist' are added, then all keywords in the |
;; `font-lock-keywords-alist' are added, then all keywords in the |
713 |
;; list `font-lock-removed-keywords-alist' are removed. If a |
;; list `font-lock-removed-keywords-alist' are removed. If a |
755 |
MODE should be a symbol, the major mode command name, such as `c-mode' |
MODE should be a symbol, the major mode command name, such as `c-mode' |
756 |
or nil. If nil, highlighting keywords are removed for the current buffer. |
or nil. If nil, highlighting keywords are removed for the current buffer. |
757 |
|
|
758 |
When used from an elisp package (such as a minor mode), it is recommended |
When used from a Lisp program (such as a minor mode), it is recommended to |
759 |
to use nil for MODE (and place the call in a loop or on a hook) to avoid |
use nil for MODE (and place the call on a hook) to avoid subtle problems |
760 |
subtle problems due to details of the implementation." |
due to details of the implementation." |
761 |
(cond (mode |
(cond (mode |
762 |
;; Remove one keyword at the time. |
;; Remove one keyword at the time. |
763 |
(dolist (keyword keywords) |
(dolist (keyword keywords) |