Skip to content
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

Remove all undo/redo history for current buffer? #108

Closed
fapdash opened this issue Jun 23, 2024 · 5 comments
Closed

Remove all undo/redo history for current buffer? #108

fapdash opened this issue Jun 23, 2024 · 5 comments

Comments

@fapdash
Copy link

fapdash commented Jun 23, 2024

Is there a way to throw away all undo/redo history information for the current buffer?

I try to do this in the following scenarios:

  1. When I accidentally yanked / pasted in a secret that I don't want to accidentally show on undo.
  2. To keep my history clean once I'm certain that I don't need any earlier history for that particular file

Of course this would also help for #68.

@jdtsmith
Copy link
Contributor

jdtsmith commented Jul 2, 2024

M-: (setq buffer-undo-list nil) is a heavy hammer that works. I sometimes reach for it when history is too deep. I do still wish for a command to specify a time frame (e.g. two weeks) and remove anything on the undo list "older" than that. That would only work for buffers which had been saved to file.

@casouri
Copy link
Owner

casouri commented Jul 3, 2024

If you really need it, it shouldn't be hard to write a command that truncates the undo history by date.

@jdtsmith
Copy link
Contributor

jdtsmith commented Jul 3, 2024

Shouldn't be just need to find a bit of time. A better fix is #106, then I wouldn't feel the need so often.

@fapdash
Copy link
Author

fapdash commented Jul 3, 2024

@jdtsmith Thank you, M-: (setq buffer-undo-list nil) was exactly what I was looking for! :)

@fapdash fapdash closed this as completed Jul 3, 2024
@jdtsmith
Copy link
Contributor

jdtsmith commented Jul 3, 2024

OK it actually wasn't too hard; give #111 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants