revert-buffer
is often slower than closing an opening the same file.
I've noticed - for example, I can undo to the state of the file before reverting.
While this might be useful in some cases, I would like to clear undo history and load the file as if I'd just opened emacs.
Some possible solutions:
Fast Revert
- Disable undo.
- Clear undo history, jump list ... etc.
- Clear the buffer.
- Load the data from the file into the buffer.
- Re-enable undo.
Fake Revert
- Store the scroll & cursor position.
- Close the buffer.
- Open the buffer.
- Restore the scroll & cursor position.
While I could write this, it seems like there may be a more elegant solution then writing my own fast-revert-buffer
function.
Does Emacs provide a way to do this already?
undo
, the previous history would be irrelevant -- as such, the undo history would be completely reset to zero / nil upon a revert.global-auto-revert-mode
withauto-revert-interval
set to a small value (I set it at1
) help?