Re: master 1d91d9b717d: project-vc-dir: Use truenames

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Dmitry Gutov [24/Jul  5:51am +03] wrote:
> I'm curious if either of you finds the same logic inside
> 'vc-refresh-state' more legible. I've had to trace it back when writing
> the patch, so it was the reference to compare. ;-)

Somehow, yes, I do find vc-refresh-state more legible.

> Anyway, how about this? Does it feel a bit repeating itself? I would
> rather remove the last sentence but as the author I'm probably not the
> best judge for that.
>
> diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
> index 1ba834d94cc..45e999d95a3 100644
> --- a/lisp/vc/vc-dir.el
> +++ b/lisp/vc/vc-dir.el
> @@ -1990,14 +1990,21 @@ vc-dir
>
>     (interactive
>      (list
> -    ;; When you hit C-x v d in a visited VC file,
> -    ;; the *vc-dir* buffer visits the directory under its truename;
> -    ;; therefore it makes sense to always do that.
> -    ;; Otherwise if you do C-x v d -> C-x C-f -> C-x v d
> -    ;; you may get a new *vc-dir* buffer, different from the original
> -    (file-truename (read-directory-name "VC status for directory: "
> -					(vc-root-dir) nil t
> -					nil))
> +    (let ((dir (read-directory-name "VC status for directory: "
> +                                    (vc-root-dir) nil t
> +                                    nil))
> +          truename)
> +      ;; Try to match the result of `vc-refresh-state' in a file buffer.
> +      ;; Otherwise if you do C-x v d -> C-x C-f -> C-x v d you may get a
> +      ;; new *vc-dir* buffer, different from the original.
> +      ;; We use the truename if the DIR has no VC backend detected, but
> +      ;; its truename differs, and has a VC backend.

I find the referent of "its" unclear here.

-- 
Sean Whitton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.