unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33295: Unhandled error in log-view-find-revision
@ 2018-11-06 21:27 Juri Linkov
  2018-11-07 22:42 ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2018-11-06 21:27 UTC (permalink / raw)
  To: 33295

0. emacs -Q

1. in the root of a vc-controlled directory:

 C-x v L   ;; vc-print-root-log

2. on any revision

 f         ;; log-view-find-revision

fails with an error:
vc-find-backend-function: Cannot open load file: No such file or directory, vc-nil

and with non-nil ‘debug-on-error’ shows a backtrace that refers to ‘require(vc-nil)’.

This is because the value of ‘log-view-vc-fileset’ in that *vc-change-log* buffer
is a directory.

This patch changes it to display a nicer error:

diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 6ff50dcde5..bfb31ccdab 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -517,8 +517,10 @@ log-view-find-revision
 If called interactively, visit the version at point."
   (interactive "d")
   (unless log-view-per-file-logs
-    (when (> (length log-view-vc-fileset) 1)
-      (error "Multiple files shown in this buffer, cannot use this command here")))
+    (when (or (> (length log-view-vc-fileset) 1)
+              (null (car log-view-vc-fileset))
+              (file-directory-p (car log-view-vc-fileset)))
+      (user-error "Multiple files shown in this buffer, cannot use this command here")))
   (save-excursion
     (goto-char pos)
     (switch-to-buffer (vc-find-revision (if log-view-per-file-logs
@@ -561,8 +563,10 @@ log-view-annotate-version
 If called interactively, annotate the version at point."
   (interactive "d")
   (unless log-view-per-file-logs
-    (when (> (length log-view-vc-fileset) 1)
-      (error "Multiple files shown in this buffer, cannot use this command here")))
+    (when (or (> (length log-view-vc-fileset) 1)
+              (null (car log-view-vc-fileset))
+              (file-directory-p (car log-view-vc-fileset)))
+      (user-error "Multiple files shown in this buffer, cannot use this command here")))
   (save-excursion
     (goto-char pos)
     (vc-annotate (if log-view-per-file-logs





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#33295: Unhandled error in log-view-find-revision
  2018-11-06 21:27 bug#33295: Unhandled error in log-view-find-revision Juri Linkov
@ 2018-11-07 22:42 ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2018-11-07 22:42 UTC (permalink / raw)
  To: 33295-done

Version: 27.1

> vc-find-backend-function: Cannot open load file: No such file or directory, vc-nil
>
> and with non-nil ‘debug-on-error’ shows a backtrace that refers to ‘require(vc-nil)’.
>
> This is because the value of ‘log-view-vc-fileset’ in that *vc-change-log* buffer
> is a directory.
>
> This patch changes it to display a nicer error:

Fixed.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-07 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 21:27 bug#33295: Unhandled error in log-view-find-revision Juri Linkov
2018-11-07 22:42 ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).