]> git.eshelyaron.com Git - emacs.git/commitdiff
dired-vc-deduce-fileset: Call vc-backend-for-registration
authorStephen Berman <stephen.berman@gmx.net>
Sat, 12 Jul 2025 10:34:31 +0000 (11:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:13:22 +0000 (10:13 +0200)
* lisp/vc/vc.el (vc-backend-for-registration):
* lisp/dired-aux.el (vc-backend-for-registration): Autoload.
(dired-vc-deduce-fileset): Call vc-backend-for-registration when
vc-responsible-backend returns nil (bug#78987).

(cherry picked from commit b406c44c824ba87d516c01466bdd1688cc55fc6f)

lisp/dired-aux.el
lisp/vc/vc.el

index a7cec53349c28fc591923212309a4866711eab13..7db34777b72f42c042f4b850d85ad66c9c1ab8fa 100644 (file)
@@ -1087,6 +1087,7 @@ Return the result of `process-file' - zero for success."
 
 (autoload 'Man-support-local-filenames "man")
 (autoload 'vc-responsible-backend "vc")
+(autoload 'vc-backend-for-registration "vc")
 
 (defvar dired-guess-shell-alist-default
   (list
@@ -3973,8 +3974,9 @@ In this case, the VERBOSE argument is ignored."
 ;;;###autoload
 (defun dired-vc-deduce-fileset
     (&optional state-model-only-files not-state-changing)
-  (let ((backend (vc-responsible-backend default-directory))
-        (files (dired-get-marked-files nil nil nil nil t)))
+  (let* ((files (dired-get-marked-files nil nil nil nil t))
+         (backend (or (vc-responsible-backend default-directory)
+                      (vc-backend-for-registration (car files)))))
     (when (and (not not-state-changing)
                (cl-some #'file-directory-p files))
       (user-error "\
index 45095a331ed09bac2547326489141a818c375708..56245f7760740b0152f524974242aebaa3307072 100644 (file)
@@ -1101,6 +1101,7 @@ Return the result of evaluating FORM."
 
 ;;; Code for deducing what fileset and backend to assume
 
+;;;###autoload
 (defun vc-backend-for-registration (file)
   "Return a backend that can be used for registering FILE.