-is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
- (interactive)
- (let ((hi-lock-mode-prev hi-lock-mode))
- (setq hi-lock-mode
- (if (null arg) (not hi-lock-mode)
- (> (prefix-numeric-value arg) 0)))
- ;; Turned on.
- (when (and (not hi-lock-mode-prev) hi-lock-mode)
- (if (not font-lock-mode) (turn-on-font-lock))
- (add-hook 'find-file-hooks 'hi-lock-find-file-hook)
- (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)
- (define-key-after menu-bar-edit-menu [hi-lock]
- (cons "Automatic Highlighting" hi-lock-menu))
- (hi-lock-find-patterns))
+is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
+ :group 'hi-lock
+ :lighter (:eval (if (or hi-lock-interactive-patterns
+ hi-lock-file-patterns)
+ " Hi" ""))
+ :global nil
+ :keymap hi-lock-map
+ (when (and (equal (buffer-name) "*scratch*")
+ load-in-progress
+ (not (interactive-p))
+ (not hi-lock-archaic-interface-message-used))
+ (setq hi-lock-archaic-interface-message-used t)
+ (if hi-lock-archaic-interface-deduce
+ (global-hi-lock-mode hi-lock-mode)
+ (warn
+ "Possible archaic use of (hi-lock-mode).
+Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers,
+use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs
+versions before 22 use the following in your .emacs file:
+
+ (if (functionp 'global-hi-lock-mode)
+ (global-hi-lock-mode 1)
+ (hi-lock-mode 1))
+")))
+ (if hi-lock-mode
+ ;; Turned on.
+ (progn
+ (unless font-lock-mode (font-lock-mode 1))
+ (define-key-after menu-bar-edit-menu [hi-lock]
+ (cons "Regexp Highlighting" hi-lock-menu))
+ (hi-lock-find-patterns)
+ (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook nil t))