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

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

[nongnu] elpa/nix-mode 0c2807f037 262/500: Cleanup nix-build.el


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 0c2807f037 262/500: Cleanup nix-build.el
Date: Sat, 29 Jan 2022 08:27:12 -0500 (EST)

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

    Cleanup nix-build.el
---
 nix-build.el | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/nix-build.el b/nix-build.el
index 0bea996f4a..df85a676d6 100644
--- a/nix-build.el
+++ b/nix-build.el
@@ -1,4 +1,4 @@
-;;; nix.el -- run nix commands in Emacs -*- lexical-binding: t -*-
+;;; nix-build.el -- run nix commands in Emacs -*- lexical-binding: t -*-
 
 ;; Author: Matthew Bauer <mjbauer95@gmail.com>
 ;; Homepage: https://github.com/NixOS/nix-mode
@@ -8,21 +8,20 @@
 
 ;;; Commentary:
 
-;; To use this just run:
-
-;; M-x RET nix-shell RET
-
-;; This will give you some
-
 ;;; Code:
 
 (require 'nix)
 (require 'nix-search)
 
-(defun nix-build (&optional attr)
-  "Run nix-build in a compilation buffer."
-  (interactive (list (nix-search-read-attr "./.")))
-  (setq compile-command (format "%s -A '%s'" nix-build-executable attr))
+(defun nix-build (&optional file attr)
+  "Run nix-build in a compilation buffer.
+FILE the file to parse.
+ATTR the attribute to build."
+  (interactive (list (nix-read-file) nil))
+  (unless attr (setq attr (nix-read-attr file)))
+
+  (setq compile-command (format "%s %s -A '%s'" nix-build-executable
+                               file attr))
   (setq-default compilation-directory default-directory)
   (compilation-start compile-command nil
                     (apply-partially (lambda (attr _)



reply via email to

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