diff options
| author | Sebastian Arlund Nørgaard <sebnorgaard@gmail.com> | 2021-12-06 12:57:07 +0100 |
|---|---|---|
| committer | Youmu <condy0919@gmail.com> | 2021-12-07 02:00:29 +0800 |
| commit | f5cc6d53ec2e5219aaf1ab273ddd85f7048d0bd5 (patch) | |
| tree | 136052879968076abfeac8c337e8b95e5118a190 | |
| parent | 96ef16b3a03e917166835359e9eb869cdaafba86 (diff) | |
consult: remove unnecessary use of advice
Since the advice is only added for the duration of a function call we
can simply let-bind the overridden function instead.
| -rw-r--r-- | modes/consult/evil-collection-consult.el | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modes/consult/evil-collection-consult.el b/modes/consult/evil-collection-consult.el index 4e0a961..1ad5926 100644 --- a/modes/consult/evil-collection-consult.el +++ b/modes/consult/evil-collection-consult.el @@ -92,13 +92,9 @@ as defined in `evil-collection-consult--evil-mark-ring'." (defun evil-collection-consult-mark () "Jump to an evil marker in the current buffer." (interactive) - (unwind-protect - (progn - (advice-add #'consult--mark-candidates :override - #'evil-collection-consult--mark-candidates) - (consult-mark (evil-collection-consult--evil-mark-ring))) - (advice-remove #'consult--mark-candidates - #'evil-collection-consult--mark-candidates))) + (cl-letf (((symbol-function 'consult--mark-candidates) + #'evil-collection-consult--mark-candidates)) + (consult-mark (evil-collection-consult--evil-mark-ring)))) ;;;###autoload (defun evil-collection-consult-setup () |
