From: Stefan Kangas Date: Sun, 2 Mar 2025 17:04:32 +0000 (+0100) Subject: Don't warn when calling hl-lock-mode from init file X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=912d13f112b9c0dc71e8ea039c16f1b5c164fc71;p=emacs.git Don't warn when calling hl-lock-mode from init file This was a compatibility kluge introduced in Emacs 22.1, twenty years ago. It's fair to assume that any former Emacs 21 user have seen this warning already, and will have updated their init file. So remove it. * lisp/hi-lock.el (hi-lock-mode): Don't warn when calling plain hi-lock-mode from init file. (hi-lock-archaic-interface-message-used) (hi-lock-archaic-interface-deduce): Remove associated variables. (cherry picked from commit fad9b7dce73d81d669cb22f880b65c867ac36b54) --- diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index a74ad37b658..eb62ba117cb 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -245,17 +245,6 @@ by cycling through the faces in `hi-lock-face-defaults'." (defvar hi-lock-file-patterns-prefix "Hi-lock" "String used to identify hi-lock patterns at the start of files.") -(defvar hi-lock-archaic-interface-message-used nil - "Non-nil if user alerted that `global-hi-lock-mode' is now the global switch. -Earlier versions of hi-lock used `hi-lock-mode' as the global switch; -the message is issued if it appears that `hi-lock-mode' is used assuming -that older functionality. This variable avoids multiple reminders.") - -(defvar hi-lock-archaic-interface-deduce nil - "If non-nil, sometimes assume that `hi-lock-mode' means `global-hi-lock-mode'. -Assumption is made if `hi-lock-mode' used in the *scratch* buffer while -a library is being loaded.") - (easy-menu-define hi-lock-menu nil "Menu for hi-lock mode." '("Hi Lock" @@ -358,17 +347,6 @@ Hi-lock: end is found. A mode is excluded if it's in the list " Hi" "")) :global nil :keymap hi-lock-map - (when (and (equal (buffer-name) "*scratch*") - load-in-progress - (not (called-interactively-p 'interactive)) - (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 "%s" - "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."))) (if hi-lock-mode ;; Turned on. (progn