From 64eeebbf6b78a5a3b174bc77563c2f3ab7bb9247 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 9 Dec 2024 10:30:02 +0000 Subject: [PATCH] chore(navigation/helm): resolve defadvice deprecation warning Switch to use newer advice-add function instead of defadvice macro. --- modules/navigation/siren-helm.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/navigation/siren-helm.el b/modules/navigation/siren-helm.el index 2d701701..49e26898 100755 --- a/modules/navigation/siren-helm.el +++ b/modules/navigation/siren-helm.el @@ -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