branch: externals/bug-hunter
commit 813d20b8f4186f0f2fdadb3fce5ba3d665399812
Author: Artur Malabarba <[email protected]>
Commit: Artur Malabarba <[email protected]>
Fix commands
---
bug-hunter.el | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/bug-hunter.el b/bug-hunter.el
index fada2f9..961f66d 100644
--- a/bug-hunter.el
+++ b/bug-hunter.el
@@ -57,14 +57,34 @@
(bug-hunter--report-print "")
(apply #'user-error r))
+(defun bug-hunter--run-form (form)
+ "Run FUNCTION with \"emacs -Q\" and return the result."
+ (let ((out-buf (generate-new-buffer "*Bug-Hunter Command*"))
+ (exec (file-truename (expand-file-name invocation-name
+ invocation-directory))))
+ (shell-command
+ (concat (shell-quote-argument exec)
+ " -Q -batch --eval "
+ (shell-quote-argument
+ (with-temp-buffer
+ (print (list 'prin1 form) (current-buffer))
+ (buffer-string))))
+ out-buf)
+ (with-current-buffer out-buf
+ (goto-char (point-max))
+ (forward-sexp -1)
+ (prog1 (read (current-buffer))
+ ;; (kill-buffer (current-buffer))
+ ))))
+
(defun bug-hunter--run-and-test (forms assertion)
"Execute FORMS in the background and test ASSERTION.
See `bug-hunter' for a description on the ASSERTION."
- (async-sandbox
- `(lambda () (condition-case er
- (progn ,@forms
- ,assertion)
- (error (cons 'error er))))))
+ (bug-hunter--run-form
+ `(condition-case er
+ (progn ,@forms
+ ,assertion)
+ (error (cons 'error er)))))
(defun bug-hunter--init-report-buffer ()
(or (get-buffer "*Bug-Hunter Report*")