How to advice `evil-delete'

York Zhao gtdplatform at gmail.com
Mon Oct 3 19:13:58 CEST 2011


> What does "C-h k y" say? Look for the word "interactive":
>
>    evil-yank is an interactive Lisp function in `evil-operators.el'.
>                    ^^^^^^^^^^^
>
> If your advice somehow turned `evil-yank' into a mere function,
> it should be indicated here.

Thank you very much for the help. I never paid attention to this details in "C-h
k", and you are right it didn't say it was an interactive function and only when
I add "(interactive)" to the yank advice "C-h k" will report an interactive
function, however, it doesn't matter what "C-h k" says, the problem is still the
same.

>
> Also, try using `defadvice' without the ARGLIST argument:
>
>    (defadvice evil-yank (around around-yank activate)
>      ad-do-it)
>
> Although it's possible to advise a function's interactive behavior,
> this shouldn't really be an issue with simple advices like above --
> `defadvice' is smart enough to recognize commands.

Removing the ARGLIST didn't help, though it counteracted the side effect of
adding "(interactive)" to "flet" in that I can again make yank work again by
re-evaluate `evil-yank' (C-M-x). I think the real question (and interesting)
here is why "flet" doesn't restore the original `evil-yank' after "ad-do-it".



More information about the implementations-list mailing list