emacs-devel
[Top][All Lists]
Advanced

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

Re: 4 minor suggestions for files.el


From: Stefan Monnier
Subject: Re: 4 minor suggestions for files.el
Date: Thu, 17 Apr 2003 17:39:10 -0400

> Ideas 1, 2 and 3 are good ideas--please install them.

Done.  People who had ideas for how to improve them or
change the defaults should feel free to do it.
(except for the :group argument which should be unnecessary)

> However, I think that the name with-errors-caught is unnatural;
> please call it report-errors.

Done.

> Please don't change the argument to revert-buffer.
> It is intentional that M-x revert-buffer RET asks for confirmation.

What is the intention exactly ?
The reaosn why I don't understand is that it is not very common
for the user to hit M-x revert-buffer RET and the only times I've
seen this happen is when the user knows full well the confirmation
is going to pop up and she'll answer "yes".

> Idea 5 would be nice in principle, but it cannot possibly
> work right.  There is no way to connect the locations
> in the undo list with the new buffer contents correctly.
> It would be an arbitrary decision, and the results of undoing
> those changes would be nonsensical.

Huh?  It works just dandy here.  The undo-log is correct (and has
the necessary entries corresponding to the insert-file operation).
The only real issue is not correctness but performance: the undo-log
might contain a very large string (if the insert-file operation had to
modify a large part of the buffer).

> The only case in which this would really work right is when the buffer
> text is unchanged.  That case may occur often in using VC.  Perhaps
> you can make insert-file-contents detect it.  insert-file-contents
> already tries to notice when text at the start of the buffer and/or
> text at the end of the buffer are unchanged.  It could preserve the
> undo list when the stuff to undo is within the unchanged areas
> of the text at the beginning or the end.

I was wondering if it would be worth it to try and make insert-file
even more clever: pass the `before' and `after' to diff and then apply
the diff by hand.  This will preserve even more of the markers
(and would make the undo-log smaller and more useful, in the case
that revert-buffer doesn't flush it).


        Stefan





reply via email to

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