]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't warn when calling hl-lock-mode from init file
authorStefan Kangas <stefankangas@gmail.com>
Sun, 2 Mar 2025 17:04:32 +0000 (18:04 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 21:02:40 +0000 (22:02 +0100)
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)

lisp/hi-lock.el

index a74ad37b65815792ea464b400b19e0b684c3b86c..eb62ba117cb26d801344cf1bf5dbcf1705bc96cf 100644 (file)
@@ -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