Skip to content

Commit 1b2818a

Browse files
MorganJamesSmithjpgrayson
authored andcommitted
stgit.el: Use advice-add' instead of defadvice'
`defadvice' is now obsolete. Use recommended advice mechanics.
1 parent 75506b3 commit 1b2818a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

contrib/stgit.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,13 +1710,16 @@ See also \\[customize-group] for the \"stgit\" group."
17101710
(setq stgit-did-advise t))
17111711
(run-hooks 'stgit-mode-hook))
17121712

1713+
(defun stgit-update-stgit-advice (&rest _ignore)
1714+
"Update work tree and index of stgit buffers.
1715+
Intended to be used to advise other functions."
1716+
(stgit-update-stgit-for-buffer :index))
1717+
17131718
(defun stgit-advise-funlist (funlist)
17141719
"Advise functions in FUNLIST to refresh stgit buffers."
17151720
(mapc (lambda (sym)
17161721
(when (fboundp sym)
1717-
(eval `(defadvice ,sym (after stgit-update-stgit-for-buffer)
1718-
(stgit-update-stgit-for-buffer :index)))
1719-
(ad-activate sym)))
1722+
(advice-add sym :after #'stgit-update-stgit-advice)))
17201723
funlist))
17211724

17221725
(defun stgit-advise ()

0 commit comments

Comments
 (0)