GNU bug report logs - #23436
[PATCH] Use the true name of a file to determine responsible vc.

Previous Next

Package: emacs;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Tue, 3 May 2016 21:34:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Hong Xu <hong <at> topbug.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 23436 <at> debbugs.gnu.org
Subject: bug#23436: [PATCH] Attemp to use the true name of a file to determine responsible vc if the genuine name does not work.
Date: Sat, 29 Oct 2016 17:42:01 -0700
[Message part 1 (text/plain, inline)]
On 2016-10-25 Tue 16:12 GMT-0700, Dmitry Gutov <dgutov <at> yandex.ru> wrote:

> On 25.10.2016 22:05, Hong Xu wrote:
>
>> I don't understand why find-alternate-file should be used.
>
> For no reason other than the resulting command could be useful in more 
> situations than just this one.
>
>> The reason we
>> used (vc-follow-link) is to pass the correct file path to
>> vc-responsible-backend. I don't see how find-alternate-file can be used here.
>
> It would open the file (or directory) than is the true name of the 
> currently visited file (or directory), and kill the previous buffer.
>
> vc-responsible-backend would be called with the true name automatically. 
> This is close to what vc-follow-link does already.
>
> But if that's definitely not what you want, how about a command like this?
>
> (defun vc-refresh-as-link-target ()
>    (interactive)
>    (let ((buffer-file-name (file-truename buffer-file-name)))
>      (vc-refresh-state)))
>
> By the way, please remind us why vc-follow-symlinks (the variable) with 
> the default value `ask' is not sufficient for you?

OK, I think I have screwed it up. vc-responsible-backend looks like a function
mainly provided for elisp programming purpose, which people can make use
in their own customization. Thus, none of these functions should be
used. Instead, file-truename or file-chase-links should be used. That
is,

    (vc-responsible-backend (file-chase-links file))

>
>>> OK, mention where?
>>
>> In the doc string.
>
> The docstring of what? Please be more precise, the less I have to think 
> about or make choices regarding documentation, the happier I am.
>
>> Maybe we should also mention `vc-responsible-backend'
>> in the info doc "Supported Version Control Systems" in general.
>
> Care to send the proposed addition in the form of a patch?

The attachment is a draft of my proposed doc change. Feel free to adjust
the contents and the language.

Hong

[vc-doc.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 8 years and 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.