branch: elpa/nix-mode
commit 0a64a5b725366a2f2623085ce49502992350bb12
Merge: 20ee8d8890 24a572c88e
Author: Matthew Bauer <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #154 from nagy/nix-fixes
Recent `show-config --json` format adaptation
---
nix-mode.org | 8 ++++----
nix-search.el | 5 +++--
nix.el | 5 ++++-
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/nix-mode.org b/nix-mode.org
index 907127878b..d5cae770df 100644
--- a/nix-mode.org
+++ b/nix-mode.org
@@ -103,7 +103,7 @@ to set up just nix-mode without use-package:
*** nix-mode
-This is a major mode for editing Nix expressons. It provides syntax
+This is a major mode for editing Nix expressions. It provides syntax
highlighting, sane defaults, and experimental indentation support.
You can set it up to handle .nix files with,
@@ -183,8 +183,8 @@ First, there are 3 commands that run Nix phases for you.
- nix-shell-configure
- nix-shell-build
-You can run any one of these to invode the correspond Nix phase. For
-instance to unpack the source for Emacs, let’s start from a dired
+You can run any one of these to invoke the corresponding Nix phase. For
+instance, to unpack the source for Emacs, let’s start from a dired
buffer,
#+BEGIN_SRC text
@@ -195,7 +195,7 @@ C-x C-f ~ RET
M-x nix-shell-unpack RET emacs RET
#+END_SRC
-This will unpack the Emacs soure code. It may take a minute or two to
+This will unpack the Emacs source code. It may take a minute or two to
unpack. After that, we can enter the Emacs directory with find-file,
#+BEGIN_SRC text
diff --git a/nix-search.el b/nix-search.el
index beaebb111e..3b95e4ff9a 100644
--- a/nix-search.el
+++ b/nix-search.el
@@ -19,8 +19,8 @@
;;;###autoload
(defun nix-search--search (search file &optional no-cache use-flakes)
(nix--process-json-nocheck "search" "--json"
- (if use-flakes "" "--file") file
- (if no-cache "--no-cache" "")
+ (unless use-flakes "--file") file
+ (when no-cache "--no-cache")
search))
(defface nix-search-pname
@@ -75,6 +75,7 @@
"Major mode for showing Nix search results.
\\{nix-search-mode-map}"
+ :interactive nil
:group 'nix-mode
(easy-menu-add nix-search-mode-menu)
diff --git a/nix.el b/nix.el
index acdf23aeb1..c95283402e 100644
--- a/nix.el
+++ b/nix.el
@@ -18,6 +18,8 @@
(require 'pcomplete)
(require 'json)
+(eval-when-compile
+ (require 'let-alist))
(defgroup nix nil
"Nix-related customizations"
@@ -196,7 +198,8 @@ OPTIONS a list of options to accept."
"Whether Nix is a version with Flakes support."
;; earlier versions reported as 3, now it’s just nix-2.4
(and (nix-is-24)
- (seq-contains-p (alist-get 'value (alist-get 'experimental-features
(nix-show-config))) "flakes")))
+ (let-alist (nix-show-config)
+ (seq-contains-p .experimental-features.value "flakes"))))
;;;###autoload
(defun pcomplete/nix ()