Skip to content

Commit f88c7f0

Browse files
MorganJamesSmithjpgrayson
authored andcommitted
stgit.el: Use `with-eval-after-load' instead of a homemade version
1 parent 1b2818a commit f88c7f0

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

contrib/stgit.el

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,18 +1724,15 @@ Intended to be used to advise other functions."
17241724

17251725
(defun stgit-advise ()
17261726
"Advise appropriate (non-stgit) git functions to refresh stgit buffers."
1727-
(mapc (lambda (arg)
1728-
(let ((feature (car arg))
1729-
(funlist (cdr arg)))
1730-
(if (featurep feature)
1731-
(stgit-advise-funlist funlist)
1732-
(add-to-list 'after-load-alist
1733-
`(,feature (stgit-advise-funlist
1734-
(quote ,funlist)))))))
1735-
;; lists of (<feature> <function> <function> ...) to be advised
1736-
'((vc-git vc-git-rename-file vc-git-revert vc-git-register)
1737-
(git git-add-file git-checkout git-revert-file git-remove-file)
1738-
(dired dired-delete-file))))
1727+
(with-eval-after-load "vc-git"
1728+
(stgit-advise-funlist
1729+
'(vc-git-rename-file vc-git-revert vc-git-register)))
1730+
(with-eval-after-load "git"
1731+
(stgit-advise-funlist
1732+
'(git-add-file git-checkout git-revert-file git-remove-file)))
1733+
(with-eval-after-load "dired"
1734+
(stgit-advise-funlist
1735+
'(dired-delete-file))))
17391736

17401737
(defvar stgit-pending-refresh-buffers nil
17411738
"Alist of (`buffer' . `mode') of buffers that need to be refreshed.

0 commit comments

Comments
 (0)