1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-23 10:34:07 +00:00

Replace add-hook load-hook with with-eval-after-load

* lisp/info.el (Info-install-speedbar-variables):
* lisp/cedet/ede.el (speedbar):
* lisp/cedet/semantic/imenu.el (speedbar):
* lisp/emacs-lisp/eieio-opt.el (eieio-class-speedbar-key-map):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-create):
* lisp/erc/erc-speedbar.el (erc-install-speedbar-variables):
* lisp/mail/rmail.el (rmail-install-speedbar-variables):
* lisp/progmodes/gud.el (gud-install-speedbar-variables):
Use with-eval-after-load.
This commit is contained in:
Glenn Morris 2020-01-16 21:21:29 -08:00
parent 98c6416bfd
commit e32bae6177
8 changed files with 14 additions and 31 deletions

View File

@ -1527,8 +1527,7 @@ It does not apply the value to buffers."
;; If this does not occur after the provide, we can get a recursive
;; load. Yuck!
(if (featurep 'speedbar)
(ede-speedbar-file-setup)
(add-hook 'speedbar-load-hook 'ede-speedbar-file-setup))
(with-eval-after-load 'speedbar
(ede-speedbar-file-setup))
;;; ede.el ends here

View File

@ -44,9 +44,8 @@
;; Because semantic imenu tags will hose the current imenu handling
;; code in speedbar, force semantic/sb in.
(if (featurep 'speedbar)
(require 'semantic/sb)
(add-hook 'speedbar-load-hook (lambda () (require 'semantic/sb))))
(with-eval-after-load 'speedbar
(require 'semantic/sb))
(defgroup semantic-imenu nil
"Semantic interface to Imenu."

View File

@ -278,14 +278,7 @@ are not abstract."
(if eieio-class-speedbar-key-map
nil
(if (not (featurep 'speedbar))
(add-hook 'speedbar-load-hook (lambda ()
(eieio-class-speedbar-make-map)
(speedbar-add-expansion-list
'("EIEIO"
eieio-class-speedbar-menu
eieio-class-speedbar-key-map
eieio-class-speedbar))))
(with-eval-after-load 'speedbar
(eieio-class-speedbar-make-map)
(speedbar-add-expansion-list '("EIEIO"
eieio-class-speedbar-menu

View File

@ -140,11 +140,7 @@ MENU-VAR is the symbol containing an easymenu compatible menu part to use.
MODENAME is a string used to identify this browser mode.
FETCHER is a generic function used to fetch the base object list used when
creating the speedbar display."
(if (not (featurep 'speedbar))
(add-hook 'speedbar-load-hook
(list 'lambda nil
(list 'eieio-speedbar-create-engine
map-fn map-var menu-var modename fetcher)))
(with-eval-after-load 'speedbar
(eieio-speedbar-create-engine map-fn map-var menu-var modename fetcher)))
(defun eieio-speedbar-create-engine (map-fn map-var menu-var modename fetcher)

View File

@ -89,9 +89,8 @@ nil - Do not sort users"
"Additional menu-items to add to speedbar frame.")
;; Make sure our special speedbar major mode is loaded
(if (featurep 'speedbar)
(erc-install-speedbar-variables)
(add-hook 'speedbar-load-hook 'erc-install-speedbar-variables))
(with-eval-after-load 'speedbar
(erc-install-speedbar-variables))
;;; ERC hierarchy display method
;;;###autoload

View File

@ -5135,9 +5135,8 @@ first line or header line, and for breadcrumb links.")
"Additional menu-items to add to speedbar frame.")
;; Make sure our special speedbar major mode is loaded
(if (featurep 'speedbar)
(Info-install-speedbar-variables)
(add-hook 'speedbar-load-hook 'Info-install-speedbar-variables))
(with-eval-after-load 'speedbar
(Info-install-speedbar-variables))
;;; Info hierarchy display method
;;;###autoload

View File

@ -4392,9 +4392,8 @@ browsing, and moving of messages."
(text face mouse function &optional token prevline))
;; Make sure our special speedbar major mode is loaded
(if (featurep 'speedbar)
(rmail-install-speedbar-variables)
(add-hook 'speedbar-load-hook 'rmail-install-speedbar-variables))
(with-eval-after-load 'speedbar
(rmail-install-speedbar-variables))
(defun rmail-speedbar-buttons (buffer)
"Create buttons for BUFFER containing rmail messages.

View File

@ -486,9 +486,8 @@ The value t means that there is no stack, and we are in display-file mode.")
"Additional menu items to add to the speedbar frame.")
;; Make sure our special speedbar mode is loaded
(if (featurep 'speedbar)
(gud-install-speedbar-variables)
(add-hook 'speedbar-load-hook 'gud-install-speedbar-variables))
(with-eval-after-load 'speedbar
(gud-install-speedbar-variables))
(defun gud-expansion-speedbar-buttons (_directory _zero)
"Wrapper for call to `speedbar-add-expansion-list'.