hlissner / evil-snipe

2-char searching ala vim-sneak & vim-seek, for evil-mode
MIT License
340 stars 25 forks source link

`advice-add` breaks Emacs 23.x #6

Closed troyp closed 9 years ago

troyp commented 9 years ago

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)

hlissner commented 9 years ago

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

hlissner commented 9 years ago

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!

troyp commented 9 years ago

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.)