emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Undo complex command


From: scame
Subject: Undo complex command
Date: Tue, 23 Mar 2021 07:05:50 +0000

I use repeat complex command often (BTW, why doesn't the built in
version have completion? It's much better that way.) and
sometimes I want to undo them.

Imagine I replaced foo with bar in the whole buffer. I do various
other changes and then it occurs to me the foo/bar replacement
was a mistake and I want to undo it. These words occur many times
in the buffer, so it's not just a matter of selecting a region
and undo that.

What if after complex operations which change the buffer
significantly (e.g. touching many lines or something) emacs
stored the diff of the changes in memory? (With some limits,
of course, e.g. number of past diffs stored, size limit, etc.)

Then if I want to revert a particular change, I could say
M-x undo-complex-change, select a command from the undo
list and then I'd get its diff in a buffer and then I
could revert any hunk or the whole diff altogether. (Like
with regular diffs the diff can be applied as long as the
text did not change significantly since then.)

What do you think? Could it be a useful feature?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]