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

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

[nongnu] elpa/nix-mode c1b1982ea7 239/500: Fix nix-instantiate.el


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode c1b1982ea7 239/500: Fix nix-instantiate.el
Date: Sat, 29 Jan 2022 08:27:10 -0500 (EST)

branch: elpa/nix-mode
commit c1b1982ea7d9dfd772a3a2ffff3e0aa2ec0e33f1
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>

    Fix nix-instantiate.el
---
 nix-instantiate.el | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/nix-instantiate.el b/nix-instantiate.el
index 4326b7b6c4..ab88e1070c 100644
--- a/nix-instantiate.el
+++ b/nix-instantiate.el
@@ -16,16 +16,19 @@
 (defun nix-instantiate--parsed (drv)
   "Get the parsed version of the .drv file.
 DRV file to load from."
-  (let ((stdout (generate-new-buffer "nix show-derivation")))
+  (let ((stdout (generate-new-buffer "nix show-derivation"))
+       result)
     (call-process nix-executable nil (list stdout nil) nil
                  "show-derivation" drv)
-    (cdar (with-current-buffer stdout
-           (when (eq (buffer-size) 0)
-             (error
-              "Error: nix show-derivation %s failed to produce any output"
-              drv))
-           (goto-char (point-min))
-           (json-read)))))
+    (setq result
+         (cdar (with-current-buffer stdout
+                 (when (eq (buffer-size) 0)
+                   (error "nix show-derivation %s failed to produce any output"
+                          drv))
+                 (goto-char (point-min))
+                 (json-read))))
+    (kill-buffer stdout)
+    result))
 
 ;;;###autoload
 (defun nix-instantiate (nix-file &optional attribute)
@@ -68,7 +71,8 @@ EVENT the event that was fired."
              (callback (lax-plist-get nix-instantiate--running-processes prop))
            (funcall callback drv)))))
     (setq nix-instantiate--running-processes
-         (lax-plist-put nix-instantiate--running-processes prop nil))
+         (lax-plist-put nix-instantiate--running-processes prop nil)))
+  (unless (process-live-p proc)
     (kill-buffer (process-buffer proc))
     (kill-buffer err)))
 



reply via email to

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