all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: offby1@blarg.net, emacs-devel@gnu.org
Subject: Re: Suggestion for autorevert.el
Date: Fri, 02 Apr 2004 20:30:50 -0500	[thread overview]
Message-ID: <E1B9Zzm-000844-2p@fencepost.gnu.org> (raw)
In-Reply-To: <200404020011.i320BJT24024@raven.dms.auburn.edu> (message from Luc Teirlinck on Thu, 1 Apr 2004 18:11:19 -0600 (CST))

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	other threads:[~2004-04-03  1:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-24 15:14 Suggestion for autorevert.el Eric Hanchrow
2004-03-25  4:06 ` Luc Teirlinck
2004-03-25  7:49 ` Richard Stallman
2004-04-01  3:30   ` Luc Teirlinck
2004-04-01  8:00     ` Juanma Barranquero
2004-04-01 17:34     ` Richard Stallman
2004-04-02  4:09       ` Luc Teirlinck
2004-04-02  4:28         ` Luc Teirlinck
2004-04-02  5:02         ` Stefan Monnier
2004-04-02 16:02           ` Luc Teirlinck
2004-04-02 23:46             ` Luc Teirlinck
     [not found]   ` <87vfktj86f.fsf@offby1.atm01.sea.blarg.net>
2004-04-02  0:11     ` Luc Teirlinck
2004-04-03  1:30       ` Richard Stallman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1B9Zzm-000844-2p@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=offby1@blarg.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.