gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
387 stars 36 forks source link

function definition is void: advice-add #3

Closed basveeling closed 8 years ago

basveeling commented 8 years ago

I'm using evil-mc on spacemacs using emacs 24.3.1 on Ubuntu 14.04 . Whenever I trigger the evil-mc-make-cursor-here command (using g r h), nothing happens and the following error appears in messages:

evil-mc-initialize-active-state: Symbol's function definition is void: advice-add

gabesoft commented 8 years ago

I wonder if you're using an older version of evil. During the initialize it's trying to add advices for two functions evil-repeat-keystrokes and evil-repeat-motion. Are both of those functions available in your setup?

basveeling commented 8 years ago

I think so, if I run (evil-repeat-keystrokes) from the ielm lisp shell, i get a note about missing arguments, same for the evil-repeat-motion command. I have the 20151012.728 version for the evil package.

gabesoft commented 8 years ago

Then maybe it's a different problem. What happens if you run evil-mc-mode interactively in a buffer where evil-mode is enabled and then try to create some cursors?

bmag commented 8 years ago

Just passing through, advice-add was added to Emacs in version 24.4, so it doesn't exist in 24.3.1. For older versions there is defadvice.

gabesoft commented 8 years ago

@bmag Thanks, that makes sense. I'll add a fix to check for advice-add and use `defadvice`` if it doesn't exist.

gabesoft commented 8 years ago

Actually I'll just update the docs to require emacs version 24.4 or above since there may be other problems on older versions.

basveeling commented 8 years ago

Ubuntu's 14.04 LTS release includes Emacs at 24.3, and some people (including myself) are not in the position to upgrade. If I plainly comment out the advice-add functions, the plugin seems to work pretty well. Any chance you would consider adding support for 24.3 as well :)?

gabesoft commented 8 years ago

I'll replace advice-add with defadvice ... And let's hope there are no other issues.

basveeling commented 8 years ago

Thanks :+1:! Let me know if you need any help with testing.

gabesoft commented 8 years ago

Added a fix. Hope it works for you now.

basveeling commented 8 years ago

Thanks! I tried installing the package from MELPA, which seems to be up to date with this repo, and I'm getting the error: error Packageemacs-24.4' is unavailable` Is this due to the requirement in this line: https://github.com/gabesoft/evil-mc/blob/3c72c15f5ffcd7a6caaf75847a6d4c082ade8b92/evil-mc.el#L10 ?

gabesoft commented 8 years ago

I updated the required emacs version.