-
Notifications
You must be signed in to change notification settings - Fork 81
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
Seems to wreck undo history #15
Comments
Taking a page out of (unwind-protect
(progn
(when (car-safe buffer-undo-list)
(undo-boundary))
(let (buffer-undo-list)
...))
(when (car-safe buffer-undo-list)
(undo-boundary))) |
Thanks for the great tip! I pushed a commit that incorporates this and some related code, we'll see if it seems to have fixed the problem I guess :) |
This reverts commit 621351b. It made it impossible to undo reformatting operations.
I must have done something wrong with the implementation, since this change made it impossible to undo reformatting operations. |
I recently created a little major mode where I wanted to ensure some modifications were registered as a single undo, perhaps it could help here? (let ((marker (prepare-change-group)))
(unwind-protect
(save-excursion
...) ;; Do all sorts of stuff)
(undo-amalgamate-change-group marker))) Edit: I see that #17 seems to have looked at this approach, but perhaps it's worth revisiting now that Emacs 26 is the minimum? Even though it doesn't alleviate the "large undo entry" problem, it seems like making sure the formatting is recorded as a single undo step this way could be worthwhile. |
When a lot of formatting is going on I seem to lose the ability to undo back very far. This is extremely bad for UX. Probably a consequence of
undo-limit
and the reformatting generating large volumes of undo data (not sure why).The text was updated successfully, but these errors were encountered: