From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: autorevert and vc Date: 28 Mar 2004 23:24:03 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200403290352.i2T3qTP07266@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080534375 29209 80.91.224.253 (29 Mar 2004 04:26:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2004 04:26:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Mar 29 06:26:10 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 1B7oLi-0003Tr-00 for ; Mon, 29 Mar 2004 06:26:10 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B7oLg-0006Pf-00 for ; Mon, 29 Mar 2004 06:26:08 +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 1B7oKf-00083F-M4 for emacs-devel@quimby.gnus.org; Sun, 28 Mar 2004 23:25:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B7oKF-0007zM-5M for emacs-devel@gnu.org; Sun, 28 Mar 2004 23:24:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B7oJi-0007bz-Eh for emacs-devel@gnu.org; Sun, 28 Mar 2004 23:24:37 -0500 Original-Received: from [206.47.199.165] (helo=simmts7-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7oJi-0007bs-6C for emacs-devel@gnu.org; Sun, 28 Mar 2004 23:24:06 -0500 Original-Received: from empanada.local ([67.71.118.2]) by simmts7-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040329042402.GKUW13427.simmts7-srv.bellnexxia.net@empanada.local>; Sun, 28 Mar 2004 23:24:02 -0500 Original-Received: by empanada.local (Postfix, from userid 502) id 8430114ABAF; Sun, 28 Mar 2004 23:24:03 -0500 (EST) Original-To: Luc Teirlinck In-Reply-To: <200403290352.i2T3qTP07266@raven.dms.auburn.edu> Original-Lines: 48 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:21043 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21043 > As I already said before, the one part of the recent changes to > autorevert.el (prior to the ones I made) which I did not check are > the vc-part of those changes. There seem to be bugs, or at the very > least nuisance features, associated with them. I'd suggest to completely take them out. Their implementation is so ugly that it's best to start over from scratch. If you don't want to take it all out, at least please remove: (if (eq revert 'vc) (vc-mode-line buffer-file-name)))))) It seems to be redundant and probably results from the fact that the original author tried to fix a problem and didn't notice when he updated his code that the current version does ;; `preserve-modes' avoids changing the (minor) modes. But we ;; do want to reset the mode for VC, so we do it explicitly. (vc-find-file-hook) just before which fixes the same problem. Another thing: why on earth do (and (boundp 'vc-mode) (string-match "[0-9]" (or vc-mode "")))) rather than (and (boundp 'vc-mode) (stringp vc-mode)) ? Also all the CVS-related code needs to be moved to vc-cvs.el. Finally, I think the idea of doing a `revert' of the file when the file has not changed is just plain wrong. If you want to update the VC-state, then update just the VC-state, but don't additionally revert the buffer. In other words the VC-state-refresh code should be completely separate from the file-buffer-refresh code since both can change independently. It can still all be in autorevert.el, but a refresh of one shouldn't necessarily force a refresh of another (currently a refresh of the buffer text forces a refresh of the VC-state, which is OK only because we don't kow how to check staleness of the VC-state so we use staleness of the buffer-text as a heuristic that the VC-state might also be stale). Stefan