-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make undo-tree an optional dependency #1360
Conversation
423ff36
to
4a336e9
Compare
Using |
@fbergroth Thanks, I've fixed this now. |
Thanks for doing this. It's working well for me. |
Since |
Hm, that's a good point. The code of goto-chg.el does have a soft dependency on undo-tree.el, but it still does declare a hard dependency on it and errors out if it cannot be loaded up successfully. |
Seems to work well for me, using the native Emacs (28+) functions. |
evil-commands.el
Outdated
@@ -1623,12 +1623,12 @@ of the block." | |||
|
|||
(evil-define-command evil-undo (count) | |||
"Undo COUNT changes in buffer using `evil-undo-function'." | |||
(interactive "<c>") | |||
(interactive "p") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps (interactive "*p")
(error if buffer is read-only)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, it doesn't seem to ever hit that case sinde read-only buffers tend to not have any undo data in the first place or allowing you to edit them to create it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. A user could potentially enable read-only-mode
after having made some changes though. I just noticed that undo-redo
used "*p"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, fixed.
I've found that setting this to undo-tree only works if you've made sure to evaluate |
Might be worth pointing that out somewhere, like the docstring of the evil-undo-system variable at least. |
Alright, I've found out my issue and pushed a fix. Now you'll get a helpful error message if undo-tree-mode has not been enabled. |
Before merging this I'd like to try removing the hard dependency of goto-chg.el on undo-tree.el, otherwise the changes to the README claiming that Evil no longer requires undo-tree.el aren't true. |
I went through the issue tracker and noticed that this PR might end up closing the following issues as well:
|
Good work. Thanks! |
I now get the error |
The options are |
Yeah it's expected. Do as the message says and customize that variable. |
I'd be thrilled if people tested this. Maybe even if a starter kit like Doom or Spacemacs enabled it. CC @hlissner @syl20bnr