[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: vc-state always calls heuristic function
From: |
klaus.berndl |
Subject: |
RE: vc-state always calls heuristic function |
Date: |
Wed, 24 Nov 2004 09:39:48 +0100 |
Stefan Monnier wrote:
>> The next version of ECB (Emacs Code browser) will display the
>> VC-state
>> of sourcefiles with image-icons in its special browsable
>> tree-windows.
>> For this a function is needed to compute the VC-state of a file.
>> Whic one
>> is used is customizable in an option of ECB - and currently
>> `vc-state' is used per default for the backend CVS, RCS and SCCS...
>> and i have wondered
>> if there is a function available which performs real checks not only
>> heuristic - now i know such a function - thanks Stefan!
>> I think i will not use vc-recompute-state per default because
>> especially with remote repositories this can be very expensive -
>> even the state-check is performed stealthy and interruptable in the
>> background as with ECB.
>
> It's only interruptible with C-g, right? I don't call that very
> "stealth" if it forces me to hit C-g (or to wait for tens of seconds).
I agree - this i wouldn't call interruptable and stealth too ;-) But in fact the
stealth-mechanism of ECB allows running arbitrary tasks when Emacs is
idle (customizable delay) and all are interruptable by any keypress or
mouse-action...
I do this via (simplified):
(while (and (not (input-pending-p))
means a stealthy task (e.g. checking the VC-state for a set of currently
displayed files in the file-browser of ECB) process this set in a while-loop
and between each pass of the loop it is interruptable..well, but of course there
remains the problem - how to interrupt if one pass takes long time...
here i have currently no real good idea how to interrupt that (unless using
C-g)...of course a potential expensive task line the VC-check could be
implementes
via asynchron cvs-calls (start-process etc...) but then i can not use the
VC-code
and moreover it would be qute compilcated to implement this... So if you have a
good idea..... ;-)
Do you call this stealth?
>
>> But i want to mentionin the docstring of that ECB-option that there
>> is another function `vc-recompute-state' a user can use if he works
>> in a fast LAN and with a CVS-server in that LAN for example....
>
>> understandable?
>
> Yes.
> Please don't. `vc-recompute-state' is an internal function, don't
> touch it, don't use it.
> There's vc-cvs-stay-local, it's customizable, it does what you want.
> Don't use vc-cvs-stay-local (of course): just tell your users that if
> they want fresh-but-slow state, they can tweak that variable.
Hmm, now i'm confused... ECB needs a function how to get the VC-state. Well,
the user can customize which function ECB should use. But if he should
not use `vc-recompute-state' how he should get fresh-but-slow state??
If only vc-state is used then tweaking vc-cvs-stay-local wil never take
effect but vc-state always call the heursitic backend-function (and
vc-cvs-state-heuristic also never uses vc-cvs-stay-local)... Would it better
to use the backend function itself - so vc-cvs-state when a user wants fresh
state (ECB allows to specify different "get-state"-functions for different
backends...)??
Klaus
>
>
> Stefan
- vc-state always calls heuristic function, klaus.berndl, 2004/11/23
- RE: vc-state always calls heuristic function, klaus.berndl, 2004/11/23
- RE: vc-state always calls heuristic function,
klaus.berndl <=
- RE: vc-state always calls heuristic function, klaus.berndl, 2004/11/24
- RE: vc-state always calls heuristic function, klaus.berndl, 2004/11/24
- RE: vc-state always calls heuristic function, klaus.berndl, 2004/11/24
- RE: vc-state always calls heuristic function, klaus.berndl, 2004/11/24