From 94ca88e334b3457637e726ef703987dc439b13f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Spiegel?= Date: Sun, 30 Oct 2005 10:39:55 +0000 Subject: [PATCH] (vc-switch-backend): Better error message if the buffer is not visiting a file under version control. --- lisp/vc.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5