summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
authorAndré Spiegel <spiegel@gnu.org>2005-10-30 10:39:55 +0000
committerAndré Spiegel <spiegel@gnu.org>2005-10-30 10:39:55 +0000
commit94ca88e334b3457637e726ef703987dc439b13f7 (patch)
tree5e75cb48bbd3999ebbfa4bdcccf6974e28c50f64 /lisp/vc.el
parent4d74a5fc8e917db49cfe2a0c66cd2b0b9a1b9e9b (diff)
downloademacs-94ca88e334b3457637e726ef703987dc439b13f7.tar.gz
(vc-switch-backend): Better error message if the buffer is not visiting a
file under version control.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 92d3979d084..eb27390cea4 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -2596,9 +2596,12 @@ By default, this command cycles through the registered backends.
To get a prompt, use a prefix argument."
(interactive
(list
- buffer-file-name
+ (or buffer-file-name
+ (error "There is no version-controlled file in this buffer"))
(let ((backend (vc-backend buffer-file-name))
(backends nil))
+ (unless backend
+ (error "File %s is not under version control" buffer-file-name))
;; Find the registered backends.
(dolist (backend vc-handled-backends)
(when (vc-call-backend backend 'registered buffer-file-name)