Subject: Re: bug#2652: 23.0.91; wacky behavior of "v" command in *vc-dir* buffer

From: Stefan Monnier <[email-masked]>
Date: Mon, 23 Mar 2009 13:34:11 -0400

>> > But I don't really want to check it in at this point without an explicit
>> > request from Stefan.
>> Removing calls to determine the backend (and replace them with backend
>> info propagated from elsewhere) is generally a good thing.

> How about this one?

Doesn't look too bad, tho "backend-arg" rings pretty poorly.  I think
this hints at the need to just use a single `backend' var (moved out of
the let into the arg) which is then defaulted via (unless backend (setq
backend (vc-backend file))).

> It removes an extra vc-backend call for each VC managed file.

Good.  Note that the issue is not performance but semantics: in most/all
of those cases, the behavior would be at best odd if the recomputed
backend were different from the caller's idea.

> And another one could be eliminated, but I am not 100% sure what this
> comment means:
>       ;; Let the backend setup any buffer-local things he needs.
>       (vc-call-backend (vc-backend buffer-file-name) 'find-file-hook))

The comment just means "run a hook so the backend can set things up".
Grep for "vc-.*-find-file-hook" to see for what it is currently used.
So yes, this should just use `backend' (which I'd prefer over `bk').

        Stefan