summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-12-29 04:41:02 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-12-29 04:41:02 +0000
commit042a0af4f87ddb8c12df2fbe823bc9abdb729211 (patch)
tree8f915496a84e2d538410acdbf1326fd3b1b851a3 /lisp/font-lock.el
parent9e1e380fdaf67980be6126a40e83cb576bf2f27f (diff)
parent80e43b74990612ce31b41725f149eb7efe4acb12 (diff)
downloademacs-042a0af4f87ddb8c12df2fbe823bc9abdb729211.tar.gz
Merged from miles@gnu.org--gnu-2005 (patch 678-680)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-678 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-679 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-680 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-468
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el27
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 49e576e59db..de366997a93 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -153,8 +153,8 @@
;;
;; (add-hook 'foo-mode-hook
;; (lambda ()
-;; (make-local-variable 'font-lock-defaults)
-;; (setq font-lock-defaults '(foo-font-lock-keywords t))))
+;; (set (make-local-variable 'font-lock-defaults)
+;; '(foo-font-lock-keywords t))))
;;; Adding Font Lock support for modes:
@@ -174,8 +174,8 @@
;;
;; and within `bar-mode' there could be:
;;
-;; (make-local-variable 'font-lock-defaults)
-;; (setq font-lock-defaults '(bar-font-lock-keywords nil t))
+;; (set (make-local-variable 'font-lock-defaults)
+;; '(bar-font-lock-keywords nil t))
;; What is fontification for? You might say, "It's to make my code look nice."
;; I think it should be for adding information in the form of cues. These cues
@@ -723,8 +723,8 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
(append keywords old)))))
;; If the keywords were compiled before, compile them again.
(if was-compiled
- (set (make-local-variable 'font-lock-keywords)
- (font-lock-compile-keywords font-lock-keywords t)))))))
+ (setq font-lock-keywords
+ (font-lock-compile-keywords font-lock-keywords t)))))))
(defun font-lock-update-removed-keyword-alist (mode keywords how)
"Update `font-lock-removed-keywords-alist' when adding new KEYWORDS to MODE."
@@ -830,8 +830,8 @@ happens, so the major mode can be corrected."
;; If the keywords were compiled before, compile them again.
(if was-compiled
- (set (make-local-variable 'font-lock-keywords)
- (font-lock-compile-keywords font-lock-keywords t)))))))
+ (setq font-lock-keywords
+ (font-lock-compile-keywords font-lock-keywords t)))))))
;;; Font Lock Support mode.
@@ -1001,8 +1001,7 @@ The value of this variable is used when Font Lock mode is turned on."
(when verbose
(format "Fontifying %s..." (buffer-name)))
;; Make sure we have the right `font-lock-keywords' etc.
- (unless font-lock-mode
- (font-lock-set-defaults))
+ (font-lock-set-defaults)
;; Make sure we fontify etc. in the whole buffer.
(save-restriction
(widen)
@@ -1574,9 +1573,9 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to
(cond ((not (and (listp keywords) (symbolp (car keywords))))
keywords)
((numberp level)
- (or (nth level keywords) (car (reverse keywords))))
+ (or (nth level keywords) (car (last keywords))))
((eq level t)
- (car (reverse keywords)))
+ (car (last keywords)))
(t
(car keywords))))
@@ -1642,8 +1641,8 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
(font-lock-remove-keywords nil removed-keywords))
;; Now compile the keywords.
(unless (eq (car font-lock-keywords) t)
- (set (make-local-variable 'font-lock-keywords)
- (font-lock-compile-keywords font-lock-keywords t))))))
+ (setq font-lock-keywords
+ (font-lock-compile-keywords font-lock-keywords t))))))
;;; Colour etc. support.