summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-02-12 16:49:21 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-02-12 16:49:21 +0000
commit558ca3c1225f6035442733d5d3fb5fd4c40a0a45 (patch)
tree4e62817bb69a8b8d581a916f34d2cc95ff940f2c /lisp/font-lock.el
parent9787268671ebbdea9f731468af84406390cd40c3 (diff)
downloademacs-558ca3c1225f6035442733d5d3fb5fd4c40a0a45.tar.gz
(font-lock-set-defaults): Unset previously set variables when needed.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 8fcd85515a4..0408d12b5d1 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1777,13 +1777,16 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
(cdr-safe (assq major-mode font-lock-removed-keywords-alist))))
(set (make-local-variable 'font-lock-defaults) defaults)
;; Syntactic fontification?
- (when (nth 1 defaults)
- (set (make-local-variable 'font-lock-keywords-only) t))
+ (if (nth 1 defaults)
+ (set (make-local-variable 'font-lock-keywords-only) t)
+ (kill-local-variable 'font-lock-keywords-only))
;; Case fold during regexp fontification?
- (when (nth 2 defaults)
- (set (make-local-variable 'font-lock-keywords-case-fold-search) t))
+ (if (nth 2 defaults)
+ (set (make-local-variable 'font-lock-keywords-case-fold-search) t)
+ (kill-local-variable 'font-lock-keywords-case-fold-search))
;; Syntax table for regexp and syntactic fontification?
- (when (nth 3 defaults)
+ (if (null (nth 3 defaults))
+ (kill-local-variable 'font-lock-syntax-table)
(set (make-local-variable 'font-lock-syntax-table)
(copy-syntax-table (syntax-table)))
(dolist (selem (nth 3 defaults))
@@ -1794,9 +1797,10 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
(mapcar 'identity (car selem))))
(modify-syntax-entry char syntax font-lock-syntax-table)))))
;; Syntax function for syntactic fontification?
- (when (nth 4 defaults)
+ (if (nth 4 defaults)
(set (make-local-variable 'font-lock-beginning-of-syntax-function)
- (nth 4 defaults)))
+ (nth 4 defaults))
+ (kill-local-variable 'font-lock-beginning-of-syntax-function))
;; Variable alist?
(dolist (x (nthcdr 5 defaults))
(set (make-local-variable (car x)) (cdr x)))