diff options
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r-- | lisp/vc/vc.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 211feddc55d..f48f6820964 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2417,11 +2417,13 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION." (defun vc-region-history (from to) "Show the history of the region FROM..TO." (interactive "r") - (let* ((lfrom (line-number-at-pos from)) - (lto (line-number-at-pos (1- to))) + (let* ((lfrom (line-number-at-pos from t)) + (lto (line-number-at-pos (1- to) t)) (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) |