From: Andre Spiegel <spiegel@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: autorevert and vc
Date: Tue, 30 Mar 2004 22:51:46 +0200 [thread overview]
Message-ID: <1080679906.29733.143.camel@localhost> (raw)
In-Reply-To: <200403301517.i2UFHa613876@raven.dms.auburn.edu>
On Tue, 2004-03-30 at 17:17, Luc Teirlinck wrote:
> 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. [...] I do not know very much about VC, but at
> first sight, I would be inclined to believe that probably the real
> way to do it would be to check the file modification times of the
> control files.
When you call vc-find-file-hook to recompute the version control state,
all that happens for CVS, RCS and SCCS is a check of file modification
times or permissions (for MCVS it's similar, SVN and Arch are slightly
more expensive, I think).
The idea is that backends can provide a vc-BACKEND-state-heuristic
function, which guesses the state by doing a fast operation like a
permission check or mtime check. If no state-heuristic function is
provided, then each computation of the state likely involves an
expensive call to the backend system.
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.)
Stefan's suggestion (vc-stale-state-p) is potentially more generic, but
perhaps it's better to wait until there is a backend where the existing
mechanism really isn't expressive enough. Stefan, what do you think?
next prev parent reply other threads:[~2004-03-30 20:51 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 [this message]
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=1080679906.29733.143.camel@localhost \
--to=spiegel@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.