# HG changeset patch # User Chong Yidong # Date 1131815872 0 # Node ID efab878cd2e1938abf1ca990fc545c418c31225d # Parent b744ba78737f412c244abc61ad97736e7473d0af * hi-lock.el (hi-lock-mode): Set the default value of font-lock-defaults. diff -r b744ba78737f -r efab878cd2e1 lisp/ChangeLog --- a/lisp/ChangeLog Sat Nov 12 14:45:08 2005 +0000 +++ b/lisp/ChangeLog Sat Nov 12 17:17:52 2005 +0000 @@ -1,3 +1,8 @@ +2005-11-12 Chong Yidong + + * hi-lock.el (hi-lock-mode): Set the default value of + font-lock-defaults. + 2005-11-11 Luc Teirlinck * find-lisp.el (find-lisp-find-dired-insert-file): Pass `string' diff -r b744ba78737f -r efab878cd2e1 lisp/hi-lock.el --- a/lisp/hi-lock.el Sat Nov 12 14:45:08 2005 +0000 +++ b/lisp/hi-lock.el Sat Nov 12 17:17:52 2005 +0000 @@ -304,8 +304,10 @@ (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 @@ (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))))