diff options
| author | Juri Linkov | 2018-11-08 00:42:28 +0200 |
|---|---|---|
| committer | Juri Linkov | 2018-11-08 00:42:28 +0200 |
| commit | 7aa5056b574a4bf05a2cbf629f173e6d94e125da (patch) | |
| tree | 46185c67459adad347016c3ba63316b30e79076c | |
| parent | 25ab0980c773bcfea7fc84bc001481999ef72a81 (diff) | |
| download | emacs-7aa5056b574a4bf05a2cbf629f173e6d94e125da.tar.gz emacs-7aa5056b574a4bf05a2cbf629f173e6d94e125da.zip | |
* 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.
| -rw-r--r-- | lisp/dired.el | 2 | ||||
| -rw-r--r-- | lisp/locate.el | 4 | ||||
| -rw-r--r-- | lisp/vc/log-view.el | 14 |
3 files changed, 12 insertions, 8 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index f2f2b76eb77..cbd85fed91c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2219,7 +2219,7 @@ directory in another window." | |||
| 2219 | (let ((raw (dired-get-filename nil t)) | 2219 | (let ((raw (dired-get-filename nil t)) |
| 2220 | file-name) | 2220 | file-name) |
| 2221 | (if (null raw) | 2221 | (if (null raw) |
| 2222 | (error "No file on this line")) | 2222 | (user-error "No file on this line")) |
| 2223 | (setq file-name (file-name-sans-versions raw t)) | 2223 | (setq file-name (file-name-sans-versions raw t)) |
| 2224 | (if (file-exists-p file-name) | 2224 | (if (file-exists-p file-name) |
| 2225 | file-name | 2225 | file-name |
diff --git a/lisp/locate.el b/lisp/locate.el index d2e640e8849..81e9696a0d8 100644 --- a/lisp/locate.el +++ b/lisp/locate.el | |||
| @@ -499,9 +499,9 @@ do not work in subdirectories. | |||
| 499 | (progn | 499 | (progn |
| 500 | (kill-buffer locate-buffer-name) | 500 | (kill-buffer locate-buffer-name) |
| 501 | (if locate-current-filter | 501 | (if locate-current-filter |
| 502 | (error "Locate: no match for %s in database using filter %s" | 502 | (user-error "Locate: no match for %s in database using filter %s" |
| 503 | search-string locate-current-filter) | 503 | search-string locate-current-filter) |
| 504 | (error "Locate: no match for %s in database" search-string)))) | 504 | (user-error "Locate: no match for %s in database" search-string)))) |
| 505 | 505 | ||
| 506 | (locate-insert-header search-string) | 506 | (locate-insert-header search-string) |
| 507 | 507 | ||
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index 6ff50dcde5f..bfb31ccdab8 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el | |||
| @@ -217,7 +217,7 @@ If it is nil, `log-view-toggle-entry-display' does nothing.") | |||
| 217 | The match group number 1 should match the file name itself.") | 217 | The match group number 1 should match the file name itself.") |
| 218 | 218 | ||
| 219 | (defvar log-view-per-file-logs t | 219 | (defvar log-view-per-file-logs t |
| 220 | "Set if to t if the logs are shown one file at a time.") | 220 | "Set to t if the logs are shown one file at a time.") |
| 221 | 221 | ||
| 222 | (defvar log-view-message-re | 222 | (defvar log-view-message-re |
| 223 | (concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. | 223 | (concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. |
| @@ -517,8 +517,10 @@ Works like `end-of-defun'." | |||
| 517 | If called interactively, visit the version at point." | 517 | If called interactively, visit the version at point." |
| 518 | (interactive "d") | 518 | (interactive "d") |
| 519 | (unless log-view-per-file-logs | 519 | (unless log-view-per-file-logs |
| 520 | (when (> (length log-view-vc-fileset) 1) | 520 | (when (or (> (length log-view-vc-fileset) 1) |
| 521 | (error "Multiple files shown in this buffer, cannot use this command here"))) | 521 | (null (car log-view-vc-fileset)) |
| 522 | (file-directory-p (car log-view-vc-fileset))) | ||
| 523 | (user-error "Multiple files shown in this buffer, cannot use this command here"))) | ||
| 522 | (save-excursion | 524 | (save-excursion |
| 523 | (goto-char pos) | 525 | (goto-char pos) |
| 524 | (switch-to-buffer (vc-find-revision (if log-view-per-file-logs | 526 | (switch-to-buffer (vc-find-revision (if log-view-per-file-logs |
| @@ -561,8 +563,10 @@ If called interactively, visit the version at point." | |||
| 561 | If called interactively, annotate the version at point." | 563 | If called interactively, annotate the version at point." |
| 562 | (interactive "d") | 564 | (interactive "d") |
| 563 | (unless log-view-per-file-logs | 565 | (unless log-view-per-file-logs |
| 564 | (when (> (length log-view-vc-fileset) 1) | 566 | (when (or (> (length log-view-vc-fileset) 1) |
| 565 | (error "Multiple files shown in this buffer, cannot use this command here"))) | 567 | (null (car log-view-vc-fileset)) |
| 568 | (file-directory-p (car log-view-vc-fileset))) | ||
| 569 | (user-error "Multiple files shown in this buffer, cannot use this command here"))) | ||
| 566 | (save-excursion | 570 | (save-excursion |
| 567 | (goto-char pos) | 571 | (goto-char pos) |
| 568 | (vc-annotate (if log-view-per-file-logs | 572 | (vc-annotate (if log-view-per-file-logs |