Skip to content

Commit

Permalink
chore(navigation/helm): resolve defadvice deprecation warning
Browse files Browse the repository at this point in the history
Switch to use newer advice-add function instead of defadvice macro.
  • Loading branch information
jimehk committed Dec 9, 2024
1 parent 021fba9 commit 64eeebb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/navigation/siren-helm.el
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,16 @@
(use-package helm-ring
:straight helm
:after (helm-global-bindings)
:init
;; This advice is borrowed from the browse-kill-ring package.
(defadvice yank-pop (around kill-ring-browse-maybe (arg))
:preface
(defun siren-helm-ring-yank-pop-advice (orig-fun &rest args)
"If last action was not a yank, run `helm-show-kill-ring' instead."
(interactive "p")
(if (not (eq last-command 'yank))
(helm-show-kill-ring)
(barf-if-buffer-read-only)
ad-do-it))
(apply orig-fun args)))

(ad-activate 'yank-pop))
:init
(advice-add 'yank-pop :around #'siren-helm-ring-yank-pop-advice))

(use-package helm-descbinds
:defer t
Expand Down

0 comments on commit 64eeebb

Please sign in to comment.