summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-hooks.el
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2014-04-20 16:24:04 -0700
committerDaniel Colascione <dancol@dancol.org>2014-04-20 16:24:04 -0700
commite8a77f2423f5e66e040a40a1d57aec640cc08dcf (patch)
treef8742934509660594c654bb90cd5c9f8150ba13f /lisp/vc/vc-hooks.el
parent0462bf34b3227cc4ac12edf35fbed7e72c311e77 (diff)
downloademacs-e8a77f2423f5e66e040a40a1d57aec640cc08dcf.tar.gz
Provide function for asking vc about project root
Diffstat (limited to 'lisp/vc/vc-hooks.el')
-rw-r--r--lisp/vc/vc-hooks.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 1cd297ae43a..ce7f2c8f4ed 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -190,6 +190,11 @@ individually should stay local."
(make-variable-buffer-local 'vc-mode)
(put 'vc-mode 'permanent-local t)
+;;; We signal this error when we try to do something a VC backend
+;;; doesn't support. Two arguments: the method that's not supported
+;;; and the backend
+(define-error 'vc-not-supported "VC method not implemented for backend")
+
(defun vc-mode (&optional _arg)
;; Dummy function for C-h m
"Version Control minor mode.
@@ -268,10 +273,10 @@ It is usually called via the `vc-call' macro."
(setq f (vc-find-backend-function backend function-name))
(push (cons function-name f) (get backend 'vc-functions)))
(cond
- ((null f)
- (error "Sorry, %s is not implemented for %s" function-name backend))
- ((consp f) (apply (car f) (cdr f) args))
- (t (apply f args)))))
+ ((null f)
+ (signal 'vc-not-supported (list function-name backend)))
+ ((consp f) (apply (car f) (cdr f) args))
+ (t (apply f args)))))
(defmacro vc-call (fun file &rest args)
"A convenience macro for calling VC backend functions.