From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: spiegel@gnu.org, emacs-devel@gnu.org
Subject: Re: autorevert and vc
Date: Tue, 30 Mar 2004 20:02:11 -0600 (CST) [thread overview]
Message-ID: <200403310202.i2V22BT17108@raven.dms.auburn.edu> (raw)
In-Reply-To: <m1brmdanc3.fsf-monnier+emacs@empanada.iro.umontreal.ca> (message from Stefan Monnier on 30 Mar 2004 19:24:39 -0500)
Stefan Monnier wrote:
> So, you might fine-tune your algorithm to only re-compute the vc-state
> every five seconds *if* the backend has a state-heuristic function.
> (You can use vc-find-backend-function to determine that.)
Sounds fair. I should adjust vc-arch accordingly, which is probably the
right thihng to do anyway.
In that case, the suggested test would be meaningless for the current
six members of `vc-handled-backends'. Indeed Arch is the _only_ one
of the six without a state-heuristic function, as determined by
`vc-find-backend-function'. What if I just commit my patch as is and
then we can always add improvements later?
One alternative is provided by the diff below, but I do not know
whether the added flexibility would be worth the corresponding added
complexity. (I did neither carefully check nor test the patch, but
its intent is, I believe, clear, and the intent is what we are
discussing right now.)
Note that this is a variable whose default value is nil. So by default,
the automatic updating every five seconds does _not_ take place.
===File ~/autorevert-diff3==================================
diff -c /home/teirllm/autorevert.save.el /home/teirllm/emacscvsdir/emacs/lisp/autorevert.el
*** /home/teirllm/autorevert.save.el Mon Mar 29 19:47:20 2004
--- /home/teirllm/emacscvsdir/emacs/lisp/autorevert.el Tue Mar 30 19:36:24 2004
***************
*** 187,203 ****
(defcustom auto-revert-check-vc-numbers nil
"If non-nil Auto Revert Mode reliably updates version control info.
This matters if a version controlled file is edited from several
! Emacs sessions. In that case, if changes in one session are saved,
! any buffers visiting the file in other sessions are updated.
! However, if the changes are checked in, the version control number
! in the mode line, as well as other version control related
! information, may not be properly updated in the other sessions.
! If you are worried about this, set this variable to a non-nil value.
! This should not cause excessive CPU usage on a reasonably fast
! machine, if it does not apply to too many version controlled buffers."
:group 'auto-revert
! :type 'boolean
:version "21.4")
(defvar global-auto-revert-ignore-buffer nil
--- 187,218 ----
(defcustom auto-revert-check-vc-numbers nil
"If non-nil Auto Revert Mode reliably updates version control info.
+ The value is a list of version control systems, for which all
+ version control info will be updated reliably. The valid
+ elements are nil and the members of `vc-handled-backends',
+ currently `RCS', `CVS', `SVN', `SCCS', `Arch', and `MCVS'.
+ Including nil in the list will just detect that a priorly
+ non-registered file has been put under version control.
+
This matters if a version controlled file is edited from several
! Emacs sessions. In that case, if changes in one session are
! saved, any buffers visiting the file in other sessions are
! reverted and their version control info is updated. However, if
! the saved changes are later checked in, without further unsaved
! changes, the version control number in the mode line, as well as
! other version control related information, may not be properly
! updated in the other sessions. If you are worried about this,
! set this variable to a non-nil value.
!
! This currently works by automatically updating the version
! control info every `auto-revert-interval' seconds. On a slow
! computer with a large number of version controlled buffers, this
! could lead to excessive CPU usage. Also, CPU usage depends
! heavily on the version control system."
:group 'auto-revert
! :type '(choice (const :tag "Detect registration" nil)
! (const RCS) (const CVS) (const SVN)
! (const SCCS) (const MCVS) (const Arch))
:version "21.4")
(defvar global-auto-revert-ignore-buffer nil
***************
*** 309,315 ****
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
;; `preserve-modes' avoids changing the (minor) modes. But we
;; do want to reset the mode for VC, so we do it manually.
! (when (or revert auto-revert-check-vc-numbers)
(vc-find-file-hook)))))
(defun auto-revert-buffers ()
--- 324,333 ----
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
;; `preserve-modes' avoids changing the (minor) modes. But we
;; do want to reset the mode for VC, so we do it manually.
! (when (or revert
! (and buffer-file-name
! (memq (vc-backend buffer-file-name)
! auto-revert-check-vc-numbers)))
(vc-find-file-hook)))))
(defun auto-revert-buffers ()
Diff finished. Tue Mar 30 19:36:33 2004
============================================================
next prev parent reply other threads:[~2004-03-31 2:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-29 3:52 autorevert and vc Luc Teirlinck
2004-03-29 4:24 ` 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 [this message]
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=200403310202.i2V22BT17108@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=emacs-devel@gnu.org \
--cc=spiegel@gnu.org \
/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).