vc-find-backend-function: Require vc for default implementations

* lisp/vc/vc-hooks.el (vc-find-backend-function): Require vc for
default implementations (bug#80254).  Report and fix due to
Daniel Mendler <mail@daniel-mendler.de>.
This commit is contained in:
Sean Whitton 2026-02-14 15:03:52 +00:00
parent 805d76790d
commit bc763572a9
2 changed files with 6 additions and 4 deletions

View file

@ -906,7 +906,7 @@ in the `project-current' call, the timeout is determined by
(project--value-in-dir 'project-vc-ignores dir))) (project--value-in-dir 'project-vc-ignores dir)))
(defun project--vc-ignores (dir backend extra-ignores) (defun project--vc-ignores (dir backend extra-ignores)
(require 'vc) (require 'vc) ; Can be removed when we require Emacs 31.1.
(append (append
(when backend (when backend
(delq (delq

View file

@ -290,16 +290,18 @@ if that doesn't exist either, return nil."
(require (intern (concat "vc-" (downcase (symbol-name backend))))) (require (intern (concat "vc-" (downcase (symbol-name backend)))))
(if (fboundp f) f (if (fboundp f) f
(let ((def (vc-make-backend-sym 'default fun))) (let ((def (vc-make-backend-sym 'default fun)))
;; Load vc.el, for default implementations, if needed.
(require 'vc)
(if (fboundp def) (cons def backend) nil)))))) (if (fboundp def) (cons def backend) nil))))))
(defun vc-call-backend (backend function-name &rest args) (defun vc-call-backend (backend function-name &rest args)
"Call for BACKEND the implementation of FUNCTION-NAME with the given ARGS. "Call BACKEND's implementation of FUNCTION-NAME with arguments ARGS.
Calls Does
(apply #\\='vc-BACKEND-FUN ARGS) (apply #\\='vc-BACKEND-FUN ARGS)
if vc-BACKEND-FUN exists (after trying to find it in vc-BACKEND.el) if vc-BACKEND-FUN exists (after trying to find it in vc-BACKEND.el)
and else calls and otherwise does
(apply #\\='vc-default-FUN BACKEND ARGS) (apply #\\='vc-default-FUN BACKEND ARGS)