From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Suggestion for autorevert.el Date: Fri, 02 Apr 2004 20:30:50 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87zna6l1kn.fsf@offby1.atm01.sea.blarg.net> <87vfktj86f.fsf@offby1.atm01.sea.blarg.net> <200404020011.i320BJT24024@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1080956684 12842 80.91.224.253 (3 Apr 2004 01:44:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Apr 2004 01:44:44 +0000 (UTC) Cc: offby1@blarg.net, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Apr 03 03:44:38 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B9aD8-00029E-00 for ; Sat, 03 Apr 2004 03:44:38 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B9aD8-0006nZ-00 for ; Sat, 03 Apr 2004 03:44:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B9aCs-0004NH-OJ for emacs-devel@quimby.gnus.org; Fri, 02 Apr 2004 20:44:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B9aB2-0003ey-7p for emacs-devel@gnu.org; Fri, 02 Apr 2004 20:42:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B9a8r-0002Yd-At for emacs-devel@gnu.org; Fri, 02 Apr 2004 20:40:44 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B9Zzm-0008EV-OH for emacs-devel@gnu.org; Fri, 02 Apr 2004 20:30:50 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1B9Zzm-000844-2p; Fri, 02 Apr 2004 20:30:50 -0500 Original-To: Luc Teirlinck In-reply-to: <200404020011.i320BJT24024@raven.dms.auburn.edu> (message from Luc Teirlinck on Thu, 1 Apr 2004 18:11:19 -0600 (CST)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21219 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21219 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. ============================================================