emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bug-hunter d0f2034 73/95: Use -q when running interacti


From: Stefan Monnier
Subject: [elpa] externals/bug-hunter d0f2034 73/95: Use -q when running interactively too.
Date: Fri, 27 Nov 2020 22:07:00 -0500 (EST)

branch: externals/bug-hunter
commit d0f203427b8e2c1848a54666816d61d084d11b4a
Author: Artur Malabarba <bruce.connor.am@gmail.com>
Commit: Artur Malabarba <bruce.connor.am@gmail.com>

    Use -q when running interactively too.
---
 bug-hunter.el | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/bug-hunter.el b/bug-hunter.el
index 8095953..929eafb 100644
--- a/bug-hunter.el
+++ b/bug-hunter.el
@@ -258,10 +258,20 @@ ARGS are passed before \"-l FILE\"."
   "Run FORM in a graphical frame and ask user about the outcome."
   (let ((file-name (bug-hunter--print-to-temp (list 'prin1 form))))
     (unwind-protect
-        (bug-hunter--run-emacs file-name)
+        (bug-hunter--run-emacs file-name "-Q")
       (delete-file file-name))
     (y-or-n-p "Did you find the problem/bug in this instance? ")))
 
+(defun bug-hunter--wrap-forms-for-eval (forms)
+  "Return FORMS wrapped in initialization code."
+  `(let ((server-name (make-temp-file "bug-hunter-temp-server-file")))
+     (delete-file server-name)
+     (if site-run-file (load site-run-file t t))
+     (run-hooks 'before-init-hook)
+     ,@forms
+     (package-initialize)
+     (run-hooks 'after-init-hook)))
+
 (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.
@@ -271,17 +281,12 @@ If ASSERTION is 'interactive, the form is run through
 modified version of the form combined with ASSERTION is run
 through `bug-hunter--run-form'."
   (if (eq assertion 'interactive)
-      (bug-hunter--run-form-interactively `(progn ,@forms))
+      (bug-hunter--run-form-interactively
+       (bug-hunter--wrap-forms-for-eval forms))
     (bug-hunter--run-form
      `(condition-case er
-          (let ((server-name (make-temp-file "bug-hunter-temp-server-file")))
-            (delete-file server-name)
-            (if site-run-file (load site-run-file t t))
-            (run-hooks 'before-init-hook)
-            ,@forms
-            (package-initialize)
-            (run-hooks 'after-init-hook)
-            ,assertion)
+          ,(append (bug-hunter--wrap-forms-for-eval forms)
+                   (list assertion))
         (error (cons 'bug-caught er))))))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]