aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2005-11-12 17:17:52 +0000
committerChong Yidong <[email protected]>2005-11-12 17:17:52 +0000
commit71dd9295e32625af37aeafeb1e620ec75b0aedc9 (patch)
tree8e430b68c3220075bffe832d4a90e1ab6b73c8e0 /lisp/hi-lock.el
parentb5cf3adf5c7202eae81fd525384b68379c33a7fa (diff)
* hi-lock.el (hi-lock-mode): Set the default value of
font-lock-defaults.
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r--lisp/hi-lock.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 84a8cd6284..63f7611bd5 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -304,8 +304,10 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
(when (and (not hi-lock-mode-prev) hi-lock-mode)
(add-hook 'find-file-hook 'hi-lock-find-file-hook)
(add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)
- (when (eq nil font-lock-defaults)
- (setq font-lock-defaults '(nil)))
+ (if (null (default-value 'font-lock-defaults))
+ (setq-default font-lock-defaults '(nil)))
+ (if (null font-lock-defaults)
+ (setq font-lock-defaults '(nil)))
(unless font-lock-mode
(font-lock-mode 1))
(define-key-after menu-bar-edit-menu [hi-lock]
@@ -322,6 +324,10 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
(setq hi-lock-interactive-patterns nil
hi-lock-file-patterns nil)
(when font-lock-mode (hi-lock-refontify)))))
+
+ (let ((fld (default-value 'font-lock-defaults)))
+ (if (and fld (listp fld) (null (car fld)))
+ (setq-default font-lock-defaults (cdr fld))))
(define-key-after menu-bar-edit-menu [hi-lock] nil)
(remove-hook 'find-file-hook 'hi-lock-find-file-hook)
(remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook))))