From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: autorevert and vc Date: Sun, 28 Mar 2004 21:52:29 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200403290352.i2T3qTP07266@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1080532689 26540 80.91.224.253 (29 Mar 2004 03:58:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2004 03:58:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Mar 29 05:58:00 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 1B7nuS-0002al-00 for ; Mon, 29 Mar 2004 05:58:00 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B7nuR-0005NL-00 for ; Mon, 29 Mar 2004 05:57:59 +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 1B7nrk-00024R-CQ for emacs-devel@quimby.gnus.org; Sun, 28 Mar 2004 22:55:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B7nre-0001zK-70 for emacs-devel@gnu.org; Sun, 28 Mar 2004 22:55:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B7nr7-0001ZX-MW for emacs-devel@gnu.org; Sun, 28 Mar 2004 22:55:04 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7nr7-0001Yg-BR for emacs-devel@gnu.org; Sun, 28 Mar 2004 22:54:33 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i2T3sWKt020778 for ; Sun, 28 Mar 2004 21:54:32 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i2T3qTP07266; Sun, 28 Mar 2004 21:52:29 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org 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:21042 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21042 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. Unlike the non-file features, the vc features are enabled by default, if global-auto-revert-mode is enabled. If nothing else, one needs a way to disable them, which the patch below provides. I personally do not know enough about vc to do a lot more than that. If one visit a file that is using RCS, it does not auto-revert, until one loads 'vc. Then it auto-reverts every auto-revert-interval seconds, regardless of whether there is any need for that. The reasons for this behavior are obvious from the code: Part of the check of whether the file needs reverting is (featurep 'vc). So no version controlled file, RCS or CVS, will be auto-reverted until vc is loaded. Apparently, that does not automatically happen by visiting a version controlled file. It does happen if one does C-x v =. I do not see what requesting a diff has to do with requesting auto-reverting. The following explains the other part of the RCS-problem: ((eq backend 'RCS) ;; TODO: ) If vc is loade that code is equivalent with: ((eq backend 'RCS) t) That can get obnoxious. When using CVS, automatic reverting every five seconds seems to occur if there is an out-of-date version backup. Maybe that is not a bug and one just should make sure to always delete such obsolete files. Since RCS and CVS are the two only version control systems I use, I do not know what happens with other systems. But no part of the code even _tries_ to handle them. I really do not know enough about vc to investigate this further. However, I believe that, even though vc-mode is not a major mode, it plays a somewhat similar role in as far as Auto-Revert mode is concerned. Hence, I propose the following patch which would allow to include vc-mode in global-auto-revert-ignore-modes. Are there any objections to this patch? ===File ~/autorevert-diff=================================== *** autorevert.el 28 Mar 2004 07:51:54 -0600 1.27 --- autorevert.el 28 Mar 2004 19:42:05 -0600 *************** *** 181,187 **** :type 'boolean) (defcustom global-auto-revert-ignore-modes '() ! "List of major modes Global Auto-Revert Mode should not check." :group 'auto-revert :type '(repeat sexp)) --- 181,189 ---- :type 'boolean) (defcustom global-auto-revert-ignore-modes '() ! "List of major modes Global Auto-Revert Mode should not check. ! This list can also include `vc-mode', meaning that Auto-Revert ! Mode should not check version controlled buffers." :group 'auto-revert :type '(repeat sexp)) *************** *** 276,283 **** (and global-auto-revert-mode (not global-auto-revert-ignore-buffer) ! (not (memq major-mode ! global-auto-revert-ignore-modes))))) (defun auto-revert-vc-cvs-file-version (file) "Get version of FILE by reading control file on disk." --- 278,286 ---- (and global-auto-revert-mode (not global-auto-revert-ignore-buffer) ! (not (memq major-mode global-auto-revert-ignore-modes)) ! (not (and (auto-revert-vc-buffer-p) ! (memq 'vc-mode global-auto-revert-ignore-modes)))))) (defun auto-revert-vc-cvs-file-version (file) "Get version of FILE by reading control file on disk." ============================================================