summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
authorTassilo Horn <tsdh@gnu.org>2020-06-11 17:02:02 +0200
committerTassilo Horn <tsdh@gnu.org>2020-06-17 18:53:13 +0200
commit6dd702a7b62a26f9aeefd045cc99ff6ed0882ec9 (patch)
treef6f22691503a0023647c6aac162de838920e8ab6 /lisp/vc
parent9682aa2f2493c89af1894ad2d52543d57f4958a5 (diff)
downloademacs-feature/bug-reference-setup.tar.gz
bug-reference-setupfeature/bug-reference-setup
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/vc.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index ce947d21f95..9b12d449785 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -964,7 +964,7 @@ use."
(throw 'found bk))))
;;;###autoload
-(defun vc-responsible-backend (file)
+(defun vc-responsible-backend (file &optional no-error)
"Return the name of a backend system that is responsible for FILE.
If FILE is already registered, return the
@@ -974,7 +974,10 @@ responsible for FILE is returned.
Note that if FILE is a symbolic link, it will not be resolved --
the responsible backend system for the symbolic link itself will
-be reported."
+be reported.
+
+If NO-ERROR is nil, signal an error that no VC backend is
+responsible for the given file."
(or (and (not (file-directory-p file)) (vc-backend file))
(catch 'found
;; First try: find a responsible backend. If this is for registration,
@@ -982,7 +985,8 @@ be reported."
(dolist (backend vc-handled-backends)
(and (vc-call-backend backend 'responsible-p file)
(throw 'found backend))))
- (error "No VC backend is responsible for %s" file)))
+ (unless no-error
+ (error "No VC backend is responsible for %s" file))))
(defun vc-expand-dirs (file-or-dir-list backend)
"Expands directories in a file list specification.