From: Charles A. Roelli Date: Wed, 20 Dec 2017 19:40:14 +0000 (+0100) Subject: Ensure current buffer is version-controlled in vc-region-history X-Git-Tag: emacs-27.0.90~5994 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d392ccd69f4925bb9990c8267a2b710c80ec5c5;p=emacs.git Ensure current buffer is version-controlled in vc-region-history * lisp/vc/vc.el (vc-region-history): Ensure buffer is version-controlled. Otherwise if a user runs it in a non-version-controlled buffer, they get the error: Cannot open load file: No such file or directory, vc-nil --- diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 211feddc55d..b1599915007 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2422,6 +2422,8 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION." (file buffer-file-name) (backend (vc-backend file)) (buf (get-buffer-create "*VC-history*"))) + (unless backend + (error "Buffer is not version controlled")) (with-current-buffer buf (setq-local vc-log-view-type 'long)) (vc-call region-history file buf lfrom lto)