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.
This commit is contained in:
Stefan Kangas 2025-03-02 18:04:32 +01:00
parent 8937dee9e4
commit fad9b7dce7

View 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