hlissner/evil-snipe

`advice-add` breaks Emacs 23.x

Closed this issue · 3 comments

evil-snipe uses the new advice-add and advice-remove, without checking whether they are bound. Since they are not present in Emacs <24.4, this version of Emacs breaks when using global-evil-snipe-mode. Once the global mode is activated, all kinds of actions, like switching buffers, using help, executing lisp and executing external commands fail with the message :

Error in post-command-hook (global-evil-snipe-mode-check-buffers): (void-function advice-add). 

(I'd fix it, but I'm not familiar with the advice system and I'd probably just introduce another bug.)
(edit: s/23.x/<24.4/g)

Good catch! I hadn't taken <24.x into account. I'll fix it once I get home.

That should do it.

It'll only futz with advising if advice-(add|remove) are available. At the moment I'm not familiar enough with (add|remove)-function to figure out an emacs <24 solution. Besides, it's a trivial failsafe (in case highlights aren't cleared on 'pre-command-hook—which I haven't been able to reproduce yet) so it isn't a priority for now.

Thanks for reporting it!

Thanks. I wasn't sure if it was important so I didn't want to just hide it.

I've finally got the versions right, btw. Emacs24.4 is the first version with the new advice system. (I didn't actually realize it was in 24.4, I thought it was still in trunk).

It doesn't break 24.3 now, although it doesn't work either. I'll open another bug for that.
(Mind you, now I've just been reading about the new 24.4 features, I want to go install it ;-) But I'll try to get this working on 24.3 first.)