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 20:21:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

Here is a new version.
>From 76e164e96552bbd8f1821dec03f0e0d35af457d7 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Fri, 12 Nov 2021 17:13:51 +0100
Subject: [PATCH] Find most specific backend for `vc-backend-for-registration'.

---
 lisp/vc/vc.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 4b56f1b795..6f5839736a 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -944,8 +944,9 @@ vc-backend-for-registration
           bk)
       (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)))
+          (let* ((dir-name (vc-call-backend backend 'responsible-p file))
+                 (len (and dir-name
+                           (length (file-name-split (expand-file-name 
dir-name))))))
             (when (and len (> len max))
               (setq max len bk backend)))))
       (when bk
-- 
2.33.1

-- 
Manuel Giraud

reply via email to

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