Closed josephmturner closed 1 year ago
This shouldn't be difficult to implement (although I'd make it optional as I think it would require a hook that runs on save). I might have a go when I get some time - if someone else doesn't get their first.
Wonderful!! Thank you!!!
Campbell Barton @.***> writes:
This shouldn't be difficult to implement. I might have a go when I get some time - if someone else doesn't get their first.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
@casouri this is how I'd implement this feature, if you have concerns - let me know.
Add an custom option (... show-saved-state
or similar), to enable the functionality, when enabled:
vundo
used the saved
face to draw the saved undo step (if it's found & has not been freed).Another possible feature that could go along with this is the ability to save the buffer at the current node without exiting the vundo buffer. That way, you can save the buffer and continue to explore the undo history.
@josephmturner agree, although I think it's mostly unrelated to this proposal, a few times I've wanted to save while the vundo buffer was active and accidentally saved the vundo
buffer it's self.
@ideasman42 You're right, that should be a separate issue: #58
@casouri this is how I'd implement this feature, if you have concerns - let me know.
Add an custom option (...
show-saved-state
or similar), to enable the functionality, when enabled:
- Add a face to use for the saved undo state.
- Add a hook to file save that stores the current undo state in a buffer local variable.
- The undo step would be wrapped in a hash containing a single weak-referenced key, so as not to hold undo data the undo system would otherwise free.
- Drawing
vundo
used thesaved
face to draw the saved undo step (if it's found & has not been freed).
Sounds good. I'll add that you want to save the non-undo record, because vundo could prune undo and redo records. You can find the non-undo record with undo-equiv-table
. Also, vundo ignores position records in the undo tree, so when you save the state (I assume you are saving the head of the undo-list), you want to go back to the first non-position records. (See the last paragraph of the comment in the Developer section of vundo.el.)
We implemented past (and current) saved node highlighting using the timestamp data in the undo stream itself; see #62 (but also #66).
@jdtsmith @casouri Thank you for adding this feature!!
You're welcome. It scratched a personal itch; only afterwards did I see others had the same!
What would it take to highlight the currently saved node in the
vundo-mode
buffer?Thank you!!