branch: externals/bug-hunter
commit 9a3e7576478421be471f62cc63680bea4af24222
Author: Artur Malabarba <[email protected]>
Commit: Artur Malabarba <[email protected]>
Indentation
---
bug-hunter.el | 90 +++++++++++++++++++++++++++++------------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/bug-hunter.el b/bug-hunter.el
index ca15c03..c7e3c36 100644
--- a/bug-hunter.el
+++ b/bug-hunter.el
@@ -210,43 +210,43 @@ LINE and COLUMN are the coordinates where EXPRESSION
started in
the file."
(when line
(bug-hunter--report "%S, line %s pos %s:"
- bug-hunter--current-file line column))
+ bug-hunter--current-file line column))
(bug-hunter--report " %s"
- (cl-case (car error)
- (end-of-file
- "There's a missing closing parenthesis, the expression on this
line never ends.")
- (invalid-read-syntax
- (let ((char (cadr error)))
- (if (member char '("]" ")"))
- (concat "There's an extra " char
- " on this position. There's probably a missing "
- (if (string= char ")") "(" "[")
- " before that.")
- (concat "There's a " char
- " on this position, and that is not valid elisp
syntax."))))
- (user-aborted
- (let* ((print-level 2)
- (print-length 15)
- (forms (cadr error))
- (size (length forms)))
- (concat "User aborted while testing the following
expressions:\n"
- (mapconcat (lambda (x) (bug-hunter--pretty-format x
4))
- (if (< size 16) forms (seq-take forms 7))
- "")
- (when (> size 16)
- (format "\n ... %s omitted expressions ...\n\n"
- (- size 14)))
- (when (> size 16)
- (mapconcat (lambda (x) (bug-hunter--pretty-format x
4))
- (seq-drop forms (- size 7)) "")))))
- (assertion-triggered
- (concat "The assertion returned the following value here:\n"
- (bug-hunter--pretty-format (cadr error) 4)))
- (t (format "The following error was signaled here:\n %S"
- error))))
+ (cl-case (car error)
+ (end-of-file
+ "There's a missing closing parenthesis, the expression on this line
never ends.")
+ (invalid-read-syntax
+ (let ((char (cadr error)))
+ (if (member char '("]" ")"))
+ (concat "There's an extra " char
+ " on this position. There's probably a missing "
+ (if (string= char ")") "(" "[")
+ " before that.")
+ (concat "There's a " char
+ " on this position, and that is not valid elisp syntax."))))
+ (user-aborted
+ (let* ((print-level 2)
+ (print-length 15)
+ (forms (cadr error))
+ (size (length forms)))
+ (concat "User aborted while testing the following expressions:\n"
+ (mapconcat (lambda (x) (bug-hunter--pretty-format x 4))
+ (if (< size 16) forms (seq-take forms 7))
+ "")
+ (when (> size 16)
+ (format "\n ... %s omitted expressions ...\n\n"
+ (- size 14)))
+ (when (> size 16)
+ (mapconcat (lambda (x) (bug-hunter--pretty-format x 4))
+ (seq-drop forms (- size 7)) "")))))
+ (assertion-triggered
+ (concat "The assertion returned the following value here:\n"
+ (bug-hunter--pretty-format (cadr error) 4)))
+ (t (format "The following error was signaled here:\n %S"
+ error))))
(when expression
(bug-hunter--report " Caused by the following expression:\n%s"
- (bug-hunter--pretty-format expression 4)))
+ (bug-hunter--pretty-format expression 4)))
(bug-hunter--report "\xc\n")
`[,error ,line ,column ,expression])
@@ -408,27 +408,27 @@ are evaluated."
((progn (bug-hunter--report "Doing some initial tests...")
(not (bug-hunter--run-and-test expressions assertion)))
(bug-hunter--report-user-error "Test failed.\n%s\n%s"
- (if assertion
- (concat "The assertion returned nil after
loading the entire file.\n"
- bug-hunter--assertion-reminder)
- "No errors signaled after loading the entire file.
+ (if assertion
+ (concat "The assertion returned nil after loading the entire
file.\n"
+ bug-hunter--assertion-reminder)
+ "No errors signaled after loading the entire file.
If you're looking for something that's not an error, use the
interactive hunt instead of the error hunt. If you have some
elisp proficiency, you can also use the assertion hunt, see this
link for some examples:
https://github.com/Malabarba/elisp-bug-hunter")
- (or assertion "")))
+ (or assertion "")))
;; Make sure we're in a forest, not a volcano.
((bug-hunter--run-and-test nil assertion)
(bug-hunter--report-user-error "Test failed.\n%s\n%s"
- (if assertion
- (concat "Assertion returned non-nil even on
emacs -Q:"
- bug-hunter--assertion-reminder)
- "Detected a signaled error even on emacs -Q. I'm
sorry, but there
+ (if assertion
+ (concat "Assertion returned non-nil even on emacs -Q:"
+ bug-hunter--assertion-reminder)
+ "Detected a signaled error even on emacs -Q. I'm sorry, but there
is something seriously wrong with your Emacs installation.
There's nothing more I can do here.")
- (or assertion "")))
+ (or assertion "")))
(t
;; Perform the actual hunt.
@@ -436,7 +436,7 @@ There's nothing more I can do here.")
(let* ((result (bug-hunter--bisect-start expressions assertion)))
(if (not result)
(bug-hunter--report-user-error "No problem was found, despite our
initial tests.\n%s"
- "I have no idea what's going on.")
+ "I have no idea what's going on.")
(let* ((pos (elt result 0))
(ret (elt result 1))
(linecol (when pos (cdr (elt rich-forms pos))))