From 7d392ccd69f4925bb9990c8267a2b710c80ec5c5 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Wed, 20 Dec 2017 20:40:14 +0100 Subject: [PATCH] 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 --- lisp/vc/vc.el | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.39.2