[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 04c3b01 05/25: Use `user-error' when we can't proceed.
From: |
Dmitry Gutov |
Subject: |
[elpa] master 04c3b01 05/25: Use `user-error' when we can't proceed. |
Date: |
Sat, 8 Dec 2018 19:19:36 -0500 (EST) |
branch: master
commit 04c3b0186832ecd2fde843a11adb092c683d3ac9
Author: Wilfred Hughes <address@hidden>
Commit: Wilfred Hughes <address@hidden>
Use `user-error' when we can't proceed.
In these situations, it's not a bug with the code, and opening the emacs
debugger is not useful. By using `user-error', the debugger is not
activated but we still terminate with an informative message.
---
diff-hl.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/diff-hl.el b/diff-hl.el
index 4f8d474..5f45e02 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/dgutov/diff-hl
;; Keywords: vc, diff
;; Version: 1.8.4
-;; Package-Requires: ((cl-lib "0.2"))
+;; Package-Requires: ((cl-lib "0.2") (emacs "24.3"))
;; This file is part of GNU Emacs.
@@ -399,7 +399,7 @@ in the source file, or the last line of the hunk above it."
`(let (beg-line end-line)
(when (eobp)
(with-current-buffer ,buffer (diff-hl-remove-overlays))
- (error "Buffer is up-to-date"))
+ (user-error "Buffer is up-to-date"))
(let (diff-auto-refine-mode)
(diff-hl-diff-skip-to ,line))
(save-excursion
@@ -420,7 +420,7 @@ in the source file, or the last line of the hunk above it."
(diff-refine-hunk))
(unless (yes-or-no-p (format "Revert current hunk in %s? "
,(cl-caadr fileset)))
- (error "Revert canceled"))
+ (user-error "Revert canceled"))
(let ((diff-advance-after-apply-hunk nil))
(diff-apply-hunk t))
(with-current-buffer ,buffer
@@ -447,7 +447,7 @@ in the source file, or the last line of the hunk above it."
(throw 'found (overlay-start o)))))))))
(if pos
(goto-char pos)
- (error "No further hunks found"))))
+ (user-error "No further hunks found"))))
(defun diff-hl-previous-hunk ()
"Go to the beginning of the previous hunk in the current buffer."
@@ -458,7 +458,7 @@ in the source file, or the last line of the hunk above it."
(interactive)
(let ((hunk (diff-hl-hunk-overlay-at (point))))
(unless hunk
- (error "No hunk at point"))
+ (user-error "No hunk at point"))
(goto-char (overlay-start hunk))
(push-mark (overlay-end hunk) nil t)))
- [elpa] master updated (cd8bbda -> 7964c46), Dmitry Gutov, 2018/12/08
- [elpa] master 0c8bf49 02/25: New option: diff-hl-margin-symbols-alist, Dmitry Gutov, 2018/12/08
- [elpa] master 1f864d6 03/25: Fix revert prompt, Dmitry Gutov, 2018/12/08
- [elpa] master f8ce39d 01/25: Solve the "cloned indirect buffer" problem, Dmitry Gutov, 2018/12/08
- [elpa] master fa74f2f 04/25: Merge pull request #80 from ryuslash/master, Dmitry Gutov, 2018/12/08
- [elpa] master 6a09f77 06/25: Merge pull request #81 from Wilfred/user_error_no_hunks, Dmitry Gutov, 2018/12/08
- [elpa] master 04c3b01 05/25: Use `user-error' when we can't proceed.,
Dmitry Gutov <=
- [elpa] master c476e40 07/25: Update the Requirements section, Dmitry Gutov, 2018/12/08
- [elpa] master 8dab389 09/25: Add separate set of faces for diff-hl-margin-mode, Dmitry Gutov, 2018/12/08
- [elpa] master 1d672dd 11/25: Clarify diff-hl-flydiff-mode docstring, Dmitry Gutov, 2018/12/08
- [elpa] master 3e9d264 08/25: Clean up diff-hl-dired process buffers, Dmitry Gutov, 2018/12/08
- [elpa] master 09b9354 12/25: Add a variable for the diff-hl-mode lighter, Dmitry Gutov, 2018/12/08
- [elpa] master bec9889 13/25: Define diff-hl-margin-unknown and diff-hl-margin-ignored, Dmitry Gutov, 2018/12/08
- [elpa] master f0b945a 14/25: Don't call vc-state unless the file exists, Dmitry Gutov, 2018/12/08
- [elpa] master ce93571 19/25: Add some FIXMEs related to #71, Dmitry Gutov, 2018/12/08
- [elpa] master 9ef21e4 15/25: Merge pull request #93 from Wilfred/handle_file_move, Dmitry Gutov, 2018/12/08
- [elpa] master 027b0d2 20/25: diff-hl-revert-hunk: Emphasize the hunk, Dmitry Gutov, 2018/12/08