From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: spiegel@gnu.org, emacs-devel@gnu.org
Subject: Re: autorevert and vc
Date: 30 Mar 2004 14:56:42 -0500 [thread overview]
Message-ID: <m1zn9yazdv.fsf-monnier+emacs@empanada.iro.umontreal.ca> (raw)
In-Reply-To: <200403300227.i2U2Rp111731@raven.dms.auburn.edu>
> It apparently does not seem to take that much CPU to update the
> VC-state (without reverting the buffer) every five seconds, whether it
> is needed or not.
Of course that depends on the revision control being used.
> The patch below takes out all original vc-code, as you suggested.
> Then it takes care of the problem that code was intended to fix by
> calling `vc-find-file-hook' unconditionally if the user requests that
> through a customizable variable. The default is nil, do not do this.
> If the user has a reasonably fast machine and worries about the
> problem, he sets it to t and forgets about it. If the user knows he
> never is going to be in that situation, he keeps it nil. Otherwise,
> he sets it to t whenever the need arises.
> Note that my patch works for all version control systems supported by
> VC (I checked it for RCS), whereas the original only worked for CVS.
> Does this look OK?
It looks fine to me.
To improve it we can add something like the following in vc-hooks.el:
(defun vc-stale-state-p (file)
(vc-call 'stale-state-p file))
(defun vc-default-stale-state-p (backend file)
t)
So you can then use `vc-stale-state-p' to check whether you need to call
vc-find-file-hook. The default is to always return t but backends can
override it with something more precise in case it's possible to determine
freshness more efficiently than doing the refresh.
Pleased check with Andre <spiegel@gnu.org>, to see whether he has a better
idea about what functionality VC should provide.
Stefan
next prev parent reply other threads:[~2004-03-30 19:56 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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1zn9yazdv.fsf-monnier+emacs@empanada.iro.umontreal.ca \
--to=monnier@iro.umontreal.ca \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.