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

    Make sure nix-instantiate-executable exists before running it
    
    Some users may not have nix-instantiate available in their
    environment. Fail silently in that case.
---
 nix-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nix-mode.el b/nix-mode.el
index 8d665f77dd..5e4cdef0ae 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -533,7 +533,8 @@ PARTS a list of regexps"
 If STR contains brackets, call nix-instantiate to find the
 location of STR. If nix-instantiate has a nonzero exit code,
 don’t do anything"
-  (when (string-match nix-re-bracket-path str)
+  (when (and (string-match nix-re-bracket-path str)
+             (executable-find nix-instantiate-executable))
     (with-temp-buffer
       (when (eq (call-process nix-instantiate-executable nil (current-buffer)
                               nil "--eval" "-E" str) 0)

Reply via email to