juliapath / evil-numbers

Increment and decrement numbers in Emacs
GNU General Public License v3.0
39 stars 6 forks source link

Do not depend on evil? #4

Open juliapath opened 6 years ago

juliapath commented 6 years ago

cofi/evil-numbers did not depend on evil. This does, but if it may be possible to drop this dependency without too much additional code.

wasamasa commented 5 years ago

You do depend on evil, so you should at the very least (require 'evil), otherwise loading up this package before evil will fail spectacularly.

edit: Seems like I've been beaten to the punch: https://github.com/janpath/evil-numbers/pull/5

rien333 commented 3 years ago

Never had evil installed, and was suddenly hit with an error this morning (I guess I updated this package some days prior). Whats up? Are you guys sure that you actually needed evil for this to work?

wasamasa commented 3 years ago

Look at the source code and the evil-define-operator calls. Those won't work without Evil. While you could use regular commands, they wouldn't be repeatable and not interact as expected with Evil. Using a regular or Evil command conditionally isn't ideal either as that would give you different behavior depending on whether you have Evil installed (that doesn't mean much) or enabled (that depends on whether you've written your init file properly or not) at the time of check.

juliapath commented 3 years ago

Maybe we could export evil and non-evil functions under different names. Not sure if I'd find the time to do that myself, but I'd be open to PRs.

ideasman42 commented 3 years ago

While in principle it would be nice to support running without evil mode. This might be some work and result in some awkward initialization logic, especially with block selection.

Note that the shift-number is a simple Emacs package with this functionality that doesn't depend on evil-mode, see https://melpa.org/#/shift-number