From: André Spiegel Date: Sun, 30 Oct 2005 10:39:55 +0000 (+0000) Subject: (vc-switch-backend): Better error message if the buffer is not visiting a X-Git-Tag: emacs-pretest-22.0.90~6193 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=94ca88e334b3457637e726ef703987dc439b13f7;p=emacs.git (vc-switch-backend): Better error message if the buffer is not visiting a file under version control. --- 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)