about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/manual/nix-install-package.xml2
-rw-r--r--local.mk2
-rw-r--r--misc/emacs/nix-mode.el23
-rw-r--r--src/nix-instantiate/nix-instantiate.cc15
4 files changed, 26 insertions, 16 deletions
diff --git a/doc/manual/nix-install-package.xml b/doc/manual/nix-install-package.xml
index 5a081cd9a612..54a66348f013 100644
--- a/doc/manual/nix-install-package.xml
+++ b/doc/manual/nix-install-package.xml
@@ -125,7 +125,7 @@ format:
 <screen>
 NIXPKG1 <replaceable>manifestURL</replaceable> <replaceable>name</replaceable> <replaceable>system</replaceable> <replaceable>drvPath</replaceable> <replaceable>outPath</replaceable></screen>
 
-The elemens are as follows:
+The elements are as follows:
 
 <variablelist>
 
diff --git a/local.mk b/local.mk
index f27a97cd4f08..6361e1872b96 100644
--- a/local.mk
+++ b/local.mk
@@ -1,5 +1,5 @@
 ifeq ($(MAKECMDGOALS), dist)
-  dist-files += $(shell git ls-files) $(shell git ls-files)
+  dist-files += $(shell git ls-files)
 endif
 
 dist-files += configure config.h.in nix.spec
diff --git a/misc/emacs/nix-mode.el b/misc/emacs/nix-mode.el
index 986edcf6e321..2c45d685760c 100644
--- a/misc/emacs/nix-mode.el
+++ b/misc/emacs/nix-mode.el
@@ -1,3 +1,9 @@
+;;; nix-mode.el --- Major mode for editing Nix expressions.
+
+;; Author: Eelco Dolstra
+;; URL: https://github.com/NixOS/nix/tree/master/misc/emacs
+;; Version: 1.0
+
 (defun nix-mode ()
   "Major mode for editing Nix expressions.
 
@@ -21,9 +27,9 @@ The hook `nix-mode-hook' is run when Nix mode is started.
 "
 
   (interactive)
-  
+
   (kill-all-local-variables)
-  
+
   (setq major-mode 'nix-mode)
   (setq mode-name "Nix")
 
@@ -53,9 +59,8 @@ The hook `nix-mode-hook' is run when Nix mode is started.
   (setq paragraph-start "[ \t]*\\(#+[ \t]*\\)?$")
   (make-local-variable 'paragraph-separate)
   (setq paragraph-separate paragraph-start)
-  
-  (run-hooks 'nix-mode-hook)
-  )
+
+  (run-hooks 'nix-mode-hook))
 
 
 (defvar nix-mode-map nil
@@ -83,8 +88,7 @@ The hook `nix-mode-hook' is run when Nix mode is started.
     ("<[a-zA-Z0-9._\\+-]+\\(/[a-zA-Z0-9._\\+-]+\\)*>"
      . font-lock-constant-face)
     ("[a-zA-Z0-9._\\+-]*\\(/[a-zA-Z0-9._\\+-]+\\)+"
-     . font-lock-constant-face)
-    ))
+     . font-lock-constant-face)))
 
 
 (defvar nix-mode-syntax-table nil
@@ -97,8 +101,7 @@ The hook `nix-mode-hook' is run when Nix mode is started.
       (modify-syntax-entry ?/ ". 14" nix-mode-syntax-table)
       (modify-syntax-entry ?* ". 23" nix-mode-syntax-table)
       (modify-syntax-entry ?# "< b" nix-mode-syntax-table)
-      (modify-syntax-entry ?\n "> b" nix-mode-syntax-table)
-      ))
+      (modify-syntax-entry ?\n "> b" nix-mode-syntax-table)))
 
 
 (defun nix-indent-line ()
@@ -111,3 +114,5 @@ The hook `nix-mode-hook' is run when Nix mode is started.
 (setq auto-mode-alist (cons '("\\.nix.in\\'" . nix-mode) auto-mode-alist))
 
 (provide 'nix-mode)
+
+;;; nix-mode.el ends here
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index afd16b3a52bb..7cdabcb92402 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -52,14 +52,19 @@ void processExpr(EvalState & state, const Strings & attrPaths,
         state.forceValue(v);
 
         PathSet context;
-        if (evalOnly)
+        if (evalOnly) {
+            Value vRes;
+            if (autoArgs.empty())
+                vRes = v;
+            else
+                state.autoCallFunction(autoArgs, v, vRes);
             if (xmlOutput)
-                printValueAsXML(state, strict, location, v, std::cout, context);
+                printValueAsXML(state, strict, location, vRes, std::cout, context);
             else {
-                if (strict) state.strictForceValue(v);
-                std::cout << v << std::endl;
+                if (strict) state.strictForceValue(vRes);
+                std::cout << vRes << std::endl;
             }
-        else {
+        } else {
             DrvInfos drvs;
             getDerivations(state, v, "", autoArgs, drvs, false);
             foreach (DrvInfos::iterator, i, drvs) {