unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: autorevert and vc
Date: Sun, 28 Mar 2004 21:52:29 -0600 (CST)	[thread overview]
Message-ID: <200403290352.i2T3qTP07266@raven.dms.auburn.edu> (raw)

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."
============================================================

             reply	other threads:[~2004-03-29  3:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29  3:52 Luc Teirlinck [this message]
2004-03-29  4:24 ` autorevert and vc Stefan Monnier
2004-03-29  4:43   ` Luc Teirlinck
2004-03-30  2:27   ` Luc Teirlinck
2004-03-30 19:56     ` Stefan Monnier
2004-04-01 10:27     ` Jari Aalto
2004-04-01 16:46       ` Luc Teirlinck
2004-03-30 15:17   ` Luc Teirlinck
2004-03-30 20:51     ` Andre Spiegel
2004-03-31  0:24       ` Stefan Monnier
2004-03-31  2:02         ` Luc Teirlinck
2004-03-31  2:15           ` Luc Teirlinck
2004-03-31  7:19           ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200403290352.i2T3qTP07266@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).