mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/vc/log-view.el: Better error handling (bug#33295).
* lisp/vc/log-view.el (log-view-find-revision) (log-view-annotate-version): Add condition to signal an error when log-view-vc-fileset contains a directory. Use user-error instead of error. * lisp/dired.el (dired-get-file-for-visit): * lisp/locate.el (locate-do-setup): Use user-error instead of error.
This commit is contained in:
parent
25ab0980c7
commit
7aa5056b57
3 changed files with 12 additions and 8 deletions
|
|
@ -2219,7 +2219,7 @@ directory in another window."
|
|||
(let ((raw (dired-get-filename nil t))
|
||||
file-name)
|
||||
(if (null raw)
|
||||
(error "No file on this line"))
|
||||
(user-error "No file on this line"))
|
||||
(setq file-name (file-name-sans-versions raw t))
|
||||
(if (file-exists-p file-name)
|
||||
file-name
|
||||
|
|
|
|||
|
|
@ -499,9 +499,9 @@ do not work in subdirectories.
|
|||
(progn
|
||||
(kill-buffer locate-buffer-name)
|
||||
(if locate-current-filter
|
||||
(error "Locate: no match for %s in database using filter %s"
|
||||
(user-error "Locate: no match for %s in database using filter %s"
|
||||
search-string locate-current-filter)
|
||||
(error "Locate: no match for %s in database" search-string))))
|
||||
(user-error "Locate: no match for %s in database" search-string))))
|
||||
|
||||
(locate-insert-header search-string)
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ If it is nil, `log-view-toggle-entry-display' does nothing.")
|
|||
The match group number 1 should match the file name itself.")
|
||||
|
||||
(defvar log-view-per-file-logs t
|
||||
"Set if to t if the logs are shown one file at a time.")
|
||||
"Set to t if the logs are shown one file at a time.")
|
||||
|
||||
(defvar log-view-message-re
|
||||
(concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS.
|
||||
|
|
@ -517,8 +517,10 @@ Works like `end-of-defun'."
|
|||
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 @@ If called interactively, visit the version at point."
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue