[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoiding revert-buffer after vc-checkin
From: |
Richard Stallman |
Subject: |
Re: avoiding revert-buffer after vc-checkin |
Date: |
Thu, 19 Jul 2007 17:21:15 -0400 |
I understand that some people find this idea completely unacceptable, so
maybe a good compromise is to just provide a way to tell revert-buffer not
to throw away the undo info, and then use it in vc.el.
There is nothing magic about the undo data structure. It is easy to
preserve it, by binding buffer-undo-list. But if you want this to
work right, you should also make undo records for any text changes
made by reverting.
It would not be terribly hard to compare the file with the buffer
contents, find what the differences will be, then revert, then
construct new undo entries for those differences. It could write the
buffer to a temp file, then use diff to localize the changes. If the
changes in the diff output make sense, it can construct undo entries.
Want to implement it?