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

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

[elpa] externals/bug-hunter 02ba202 23/95: Don't use shell-command


From: Stefan Monnier
Subject: [elpa] externals/bug-hunter 02ba202 23/95: Don't use shell-command
Date: Fri, 27 Nov 2020 22:06:50 -0500 (EST)

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

    Don't use shell-command
---
 bug-hunter.el | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/bug-hunter.el b/bug-hunter.el
index 1de4795..fc0e857 100644
--- a/bug-hunter.el
+++ b/bug-hunter.el
@@ -96,21 +96,26 @@
   "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)
+                                               invocation-directory)))
+        (file-name (make-temp-file "bug-hunter")))
+    (unwind-protect
+        (progn
+          (with-temp-file file-name
+            (let ((print-length nil)
+                  (print-level nil))
+              (print (list 'prin1 form) (current-buffer)))
+            (buffer-string))
+          (shell-command
+           (concat (shell-quote-argument exec)
+                   " -Q --batch -l "
+                   (shell-quote-argument file-name))
+           out-buf))
+      (delete-file file-name))
     (with-current-buffer out-buf
       (goto-char (point-max))
       (forward-sexp -1)
       (prog1 (read (current-buffer))
-        ;; (kill-buffer (current-buffer))
-        ))))
+        (kill-buffer (current-buffer))))))
 
 (defun bug-hunter--run-and-test (forms assertion)
   "Execute FORMS in the background and test ASSERTION.



reply via email to

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