diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-12-19 19:57:22 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-12-19 19:57:22 +0000 |
commit | e93b29568add51c918892153759a1fcd440e85be (patch) | |
tree | 4ca3494b355f5df3d0cdbe155eeaa3f630f293c1 /lisp/font-lock.el | |
parent | 8d3cdf56502e89f00e86b02f24422acfa1b34beb (diff) | |
parent | 3031d8b0bb97f21c79b3022ff3e7564173facd18 (diff) | |
download | emacs-e93b29568add51c918892153759a1fcd440e85be.tar.gz emacs-e93b29568add51c918892153759a1fcd440e85be.tar.bz2 emacs-e93b29568add51c918892153759a1fcd440e85be.zip |
Merged from miles@gnu.org--gnu-2005 (patch 169-173, 671-676)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-671
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-672
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-673
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-674
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-675
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-169
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-170
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-171
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-172
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-173
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-454
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 645ff179080..58fdf6dd809 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -463,13 +463,13 @@ optimized.") (defvar font-lock-keywords-alist nil "Alist of additional `font-lock-keywords' elements for major modes. -Each element has the form (MODE KEYWORDS . APPEND). +Each element has the form (MODE KEYWORDS . HOW). `font-lock-set-defaults' adds the elements in the list KEYWORDS to `font-lock-keywords' when Font Lock is turned on in major mode MODE. -If APPEND is nil, KEYWORDS are added at the beginning of +If HOW is nil, KEYWORDS are added at the beginning of `font-lock-keywords'. If it is `set', they are used to replace the -value of `font-lock-keywords'. If APPEND is any other non-nil value, +value of `font-lock-keywords'. If HOW is any other non-nil value, they are added at the end. This is normally set via `font-lock-add-keywords' and @@ -650,15 +650,15 @@ Major/minor modes can set this variable if they know which option applies.") (font-lock-unfontify-buffer) (font-lock-turn-off-thing-lock))) -(defun font-lock-add-keywords (mode keywords &optional append) +(defun font-lock-add-keywords (mode keywords &optional how) "Add highlighting KEYWORDS for MODE. MODE should be a symbol, the major mode command name, such as `c-mode' or nil. If nil, highlighting keywords are added for the current buffer. KEYWORDS should be a list; see the variable `font-lock-keywords'. By default they are added at the beginning of the current highlighting list. -If optional argument APPEND is `set', they are used to replace the current -highlighting list. If APPEND is any other non-nil value, they are added at the +If optional argument HOW is `set', they are used to replace the current +highlighting list. If HOW is any other non-nil value, they are added at the end of the current highlighting list. For example: @@ -691,17 +691,17 @@ Note that some modes have specialized support for additional patterns, e.g., see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', `objc-font-lock-extra-types' and `java-font-lock-extra-types'." (cond (mode - ;; If MODE is non-nil, add the KEYWORDS and APPEND spec to + ;; If MODE is non-nil, add the KEYWORDS and HOW spec to ;; `font-lock-keywords-alist' so `font-lock-set-defaults' uses them. - (let ((spec (cons keywords append)) cell) + (let ((spec (cons keywords how)) cell) (if (setq cell (assq mode font-lock-keywords-alist)) - (if (eq append 'set) + (if (eq how 'set) (setcdr cell (list spec)) (setcdr cell (append (cdr cell) (list spec)))) (push (list mode spec) font-lock-keywords-alist))) ;; Make sure that `font-lock-removed-keywords-alist' does not ;; contain the new keywords. - (font-lock-update-removed-keyword-alist mode keywords append)) + (font-lock-update-removed-keyword-alist mode keywords how)) (t ;; Otherwise set or add the keywords now. ;; This is a no-op if it has been done already in this buffer @@ -712,13 +712,13 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', (if was-compiled (setq font-lock-keywords (cadr font-lock-keywords))) ;; Now modify or replace them. - (if (eq append 'set) + (if (eq how 'set) (setq font-lock-keywords keywords) (font-lock-remove-keywords nil keywords) ;to avoid duplicates (let ((old (if (eq (car-safe font-lock-keywords) t) (cdr font-lock-keywords) font-lock-keywords))) - (setq font-lock-keywords (if append + (setq font-lock-keywords (if how (append old keywords) (append keywords old))))) ;; If the keywords were compiled before, compile them again. @@ -726,7 +726,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', (set (make-local-variable 'font-lock-keywords) (font-lock-compile-keywords font-lock-keywords t))))))) -(defun font-lock-update-removed-keyword-alist (mode keywords append) +(defun font-lock-update-removed-keyword-alist (mode keywords how) "Update `font-lock-removed-keywords-alist' when adding new KEYWORDS to MODE." ;; When font-lock is enabled first all keywords in the list ;; `font-lock-keywords-alist' are added, then all keywords in the @@ -736,7 +736,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', ;; will not take effect. (let ((cell (assq mode font-lock-removed-keywords-alist))) (if cell - (if (eq append 'set) + (if (eq how 'set) ;; A new set of keywords is defined. Forget all about ;; our old keywords that should be removed. (setq font-lock-removed-keywords-alist @@ -786,14 +786,14 @@ happens, so the major mode can be corrected." ;; If MODE is non-nil, remove the KEYWORD from ;; `font-lock-keywords-alist'. (when top-cell - (dolist (keyword-list-append-pair (cdr top-cell)) - ;; `keywords-list-append-pair' is a cons with a list of - ;; keywords in the car top-cell and the original append + (dolist (keyword-list-how-pair (cdr top-cell)) + ;; `keywords-list-how-pair' is a cons with a list of + ;; keywords in the car top-cell and the original how ;; argument in the cdr top-cell. - (setcar keyword-list-append-pair - (delete keyword (car keyword-list-append-pair)))) - ;; Remove keyword list/append pair when the keyword list - ;; is empty and append doesn't specify `set'. (If it + (setcar keyword-list-how-pair + (delete keyword (car keyword-list-how-pair)))) + ;; Remove keyword list/how pair when the keyword list + ;; is empty and how doesn't specify `set'. (If it ;; should be deleted then previously deleted keywords ;; would appear again.) (let ((cell top-cell)) |