bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50572: 28.0.50; [PATCH] fix VC to find the responsible backend with


From: Manuel Giraud
Subject: bug#50572: 28.0.50; [PATCH] fix VC to find the responsible backend with the most specific path.
Date: Fri, 12 Nov 2021 16:09:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

Eli Zaretskii <eliz@gnu.org> writes:

[...]

>> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
>> index 4b56f1b795..b8f0425393 100644
>> --- a/lisp/vc/vc.el
>> +++ b/lisp/vc/vc.el
>> @@ -945,7 +945,7 @@ vc-backend-for-registration
>>        (dolist (backend vc-handled-backends)
>>          (when (not (vc-call-backend backend 'registered file))
>>            (let* ((path (vc-call-backend backend 'responsible-p file))
>> -                 (len (length path)))
>> +                 (len (and path (length (file-name-split path)))))
>>              (when (and len (> len max))
>>                (setq max len bk backend)))))
>>        (when bk
>
> Please don't use "path" for anything that is not PATH-style directory
> lists.

Ok but I have hard time figuring out what would be a correct name here
because (vc-call-backend backend 'responsible-p file) returns a path (or
nil) if the backend is responsible. Does "path-string" will do?

> Also, shouldn't the file name(s) be run through expand-file-name, to
> make sure they are absolute?  Otherwise comparing the length will not
> DTRT.

Ok, I'll do this but I'll also need a new name here (in case of a nil
returned by vc-call-backend): "expanded-path-string" ?
-- 
Manuel Giraud





reply via email to

[Prev in Thread] Current Thread [Next in Thread]