emacs-devel
[Top][All Lists]
Advanced

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

Re: Suggestion for autorevert.el


From: Richard Stallman
Subject: Re: Suggestion for autorevert.el
Date: Fri, 02 Apr 2004 20:30:50 -0500

In Emacs 19 or so, I changed M-x revert so that it would try to keep
point with the text, most of the time.  I don't know any way to do
it perfectly, of course.  But it can be done right if point is in
unchanged text before all the changes, or after all the changes.

    Which is wrong (or obsolete).  To see that it is wrong, save a file
    "myfile" with only content "123456789" and position point in the
    buffer on the `6'.  Then do `echo abcdefghi > myfile' from a shell.
    Then revert.  If the above description were accurate, point would be
    on the letter `f'.  Instead, it is at the beginning of the buffer.

Perhaps that is correct behavior in that case, because there is no
unaltered text at the beginning or at the end.

However, I think I have seen incorrect handling of this over the past
couple of years, in cases where character set decoding was going on.
I never tried to debug it.


This change is good:

*** files.texi  20 Jan 2004 16:17:38 -0600      1.87
--- files.texi  01 Apr 2004 17:29:17 -0600      
***************
*** 855,865 ****
  the current buffer.  Since reverting a buffer unintentionally could lose
  a lot of work, you must confirm this command with @kbd{yes}.
  
!   @code{revert-buffer} keeps point at the same distance (measured in
! characters) from the beginning of the file.  If the file was edited only
! slightly, you will be at approximately the same piece of text after
! reverting as before.  If you have made drastic changes, the same value of
! point in the old file may address a totally different piece of text.
  
    Reverting marks the buffer as ``not modified'' until another change is
  made.
--- 855,864 ----
  the current buffer.  Since reverting a buffer unintentionally could lose
  a lot of work, you must confirm this command with @kbd{yes}.
  
!   @code{revert-buffer} tries to position point in such a way that, if
! the file was edited only slightly, you will be at approximately the
! same piece of text after reverting as before.  If you have made drastic
! changes, point may wind up in a totally different piece of text.
  
    Reverting marks the buffer as ``not modified'' until another change is
  made.
============================================================




reply via email to

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