Make more load-hooks obsolete (Bug#21563)

* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-complete-structtag.el: Recommend
with-eval-after-load instead of load-hooks.
* lisp/calc/calc-ext.el (calc-ext-load-hook):
* lisp/emacs-lisp/bytecomp.el (bytecomp-load-hook):
* lisp/emacs-lisp/cl-extra.el (cl-extra-load-hook):
* lisp/emacs-lisp/cl-macs.el (cl-macs-load-hook):
* lisp/emacs-lisp/cl-seq.el (cl-seq-load-hook):
* lisp/gnus/message.el (message-load-hook):
* lisp/gnus/nnheader.el (nnheader-load-hook):
* lisp/gnus/nnmail.el (nnmail-load-hook):
* lisp/progmodes/dcl-mode.el (dcl-mode-load-hook):
* lisp/textmodes/tex-mode.el (tex-mode-load-hook):
* lisp/whitespace.el (whitespace-load-hook): Obsolete for
with-eval-after-load.  Note that these variables are never declared,
but the byte-compiler will still warn about them if used.
This commit is contained in:
Stefan Kangas 2020-10-20 19:10:51 +02:00
parent 4a575eb18c
commit 6c58d90042
12 changed files with 26 additions and 7 deletions

View file

@ -3458,6 +3458,8 @@ A command spec is a command name symbol, a keyboard macro string, a
list containing a numeric entry string, or nil.
A key may contain additional specs for Inverse, Hyperbolic, and Inv+Hyp.")
(make-obsolete-variable 'calc-ext-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'calc-ext-load-hook)
(provide 'calc-ext)

View file

@ -5259,6 +5259,8 @@ and corresponding effects."
byte-compile-variable-ref))))
nil)
(make-obsolete-variable 'bytecomp-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'bytecomp-load-hook)
;;; bytecomp.el ends here

View file

@ -910,6 +910,8 @@ Outputs to the current buffer."
(mapc #'cl--describe-class-slot cslots))))
(make-obsolete-variable 'cl-extra-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'cl-extra-load-hook)
;; Local variables:

View file

@ -3430,6 +3430,8 @@ STRUCT and SLOT-NAME are symbols. INST is a structure instance."
(nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst)
(aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name)))))))
(make-obsolete-variable 'cl-macs-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'cl-macs-load-hook)
;; Local variables:

View file

@ -1042,6 +1042,8 @@ Atoms are compared by `eql'; cons cells are compared recursively.
(and (not (consp cl-x)) (not (consp cl-y)) (cl--check-match cl-x cl-y)))
(make-obsolete-variable 'cl-seq-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'cl-seq-load-hook)
;; Local variables:

View file

@ -8863,6 +8863,8 @@ will then start up Emacs ready to compose mail."
(provide 'message)
(make-obsolete-variable 'message-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'message-load-hook)
;; Local Variables:

View file

@ -1067,6 +1067,8 @@ See `find-file-noselect' for the arguments."
(setq nnheader-last-message-time now)
(apply 'nnheader-message args))))
(make-obsolete-variable 'nnheader-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'nnheader-load-hook)
(provide 'nnheader)

View file

@ -2082,6 +2082,8 @@ Doesn't change point."
(format "%S" split)
"\n"))))
(make-obsolete-variable 'nnmail-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'nnmail-load-hook)
(provide 'nnmail)

View file

@ -557,8 +557,7 @@ Variables controlling indentation style and extra features:
dcl-imenu-label-call
Change the text that is used as sub-listing labels in imenu.
Loading this package calls the value of the variable
`dcl-mode-load-hook' with no args, if that value is non-nil.
To run code after DCL mode has loaded, use `with-eval-after-load'.
Turning on DCL mode calls the value of the variable `dcl-mode-hook'
with no args, if that value is non-nil.
@ -2192,6 +2191,8 @@ otherwise return nil."
(provide 'dcl-mode)
(make-obsolete-variable 'dcl-mode-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'dcl-mode-load-hook) ; for your customizations
;;; dcl-mode.el ends here

View file

@ -53,11 +53,10 @@
;;
;; INSTALLATION
;; ============
;; Put this file on the emacs load path and load it with the following
;; line in your init file:
;; Load it with the following line in your init file:
;;
;; (add-hook 'idlwave-load-hook
;; (lambda () (require 'idlw-complete-structtag)))
;; (with-eval-after-load 'idlwave
;; (require 'idlw-complete-structtag))
;;
;; DESCRIPTION
;; ===========

View file

@ -3541,6 +3541,8 @@ There might be text before point."
(process-send-region tex-chktex--process (point-min) (point-max))
(process-send-eof tex-chktex--process))))
(make-obsolete-variable 'tex-mode-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'tex-mode-load-hook)
(provide 'tex-mode)

View file

@ -2473,7 +2473,8 @@ It should be added buffer-locally to `write-file-functions'."
(provide 'whitespace)
(make-obsolete-variable 'whitespace-load-hook
"use `with-eval-after-load' instead." "28.1")
(run-hooks 'whitespace-load-hook)