[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 8a5c9d3437 4/4: Merge pull request #183 from nagy
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 8a5c9d3437 4/4: Merge pull request #183 from nagy/compiler-warnings |
Date: |
Wed, 29 Mar 2023 16:00:06 -0400 (EDT) |
branch: elpa/nix-mode
commit 8a5c9d3437a7b21e3a10df635c8ec283eda1ad08
Merge: 43bb31e6e0 56783d7219
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #183 from nagy/compiler-warnings
Fix some compiler warnings
---
.github/workflows/test.yml | 2 +-
Makefile | 4 +++-
flake.lock | 6 +++---
flake.nix | 11 ++++-------
nix-edit.el | 2 +-
nix-format.el | 15 +++++++--------
nix-search.el | 2 +-
nix-store.el | 5 +++--
8 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9598e395f1..d71613df03 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -18,6 +18,6 @@ jobs:
with:
nix_path: nixpkgs=channel:${{ matrix.nixpkgs_channel }}
#- run: nix build
- - run: nix-build -E '(import ./.).defaultPackage.${builtins.currentSystem}'
+ - run: nix-build -E '(import ./.).packages.${builtins.currentSystem}'
#- run: nix flake check
- run: nix-build -E '(import ./.).checks.${builtins.currentSystem}'
diff --git a/Makefile b/Makefile
index 59976649ea..e54d13b5fc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,13 @@
.PHONY: test clean install run
-ELS = nix.el nix-company.el nix-drv-mode.el nix-format.el \
+ELS = nix.el nix-company.el nix-drv-mode.el nix-flake.el nix-format.el \
nix-instantiate.el nix-mode.el nix-mode-mmm.el \
nix-prettify-mode.el nix-repl.el nix-search.el nix-shebang.el \
nix-shell.el nix-store.el
ELCS = $(ELS:.el=.elc)
+DOCS = nix-mode.pdf nix-mode.html nix-mode.info
+
TESTS = tests/nix-mode-tests.el tests/nix-font-lock-tests.el
DESTDIR =
diff --git a/flake.lock b/flake.lock
index c1ea218760..f08866fcfd 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1634436779,
- "narHash": "sha256-D/nrXTWpe1bPIjFy85sgiLHYqu+AeaC6v5/+KlA9PRg=",
+ "lastModified": 1679944645,
+ "narHash": "sha256-e5Qyoe11UZjVfgRfwNoSU57ZeKuEmjYb77B9IVW7L/M=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9aeeb7574fb784eaf6395f4400705b5f619e6cc3",
+ "rev": "4bb072f0a8b267613c127684e099a70e1f6ff106",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index bffea7cd0d..5757957691 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,16 +8,15 @@
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in {
packages = forAllSystems (system: with (import nixpkgs { inherit system;
}); {
- nix-mode = let
+ default = let
emacs = emacsWithPackages (epkgs: with epkgs; [
- org-plus-contrib
+ org-contrib
company
mmm-mode
- f
magit-section
transient
]);
- in stdenvNoCC.mkDerivation {
+ in stdenv.mkDerivation {
pname = "nix-mode";
version = "1.5.0";
src = self;
@@ -31,12 +30,10 @@
};
});
- defaultPackage = forAllSystems (system: self.packages.${system}.nix-mode);
-
# checks are run in ‘make check’ right now we should probably move
# these to its own derivation
checks = forAllSystems (system: {
- inherit (self.packages.${system}) nix-mode;
+ inherit (self.packages.${system}) default;
});
};
}
diff --git a/nix-edit.el b/nix-edit.el
index 709a7ff92b..941c46e362 100644
--- a/nix-edit.el
+++ b/nix-edit.el
@@ -27,7 +27,7 @@ ATTR the attribute to find in nix expressions."
(call-process nix-executable nil (list stdout nil) nil
"edit" "-f" file attr)
(with-current-buffer stdout
- (when (eq (buffer-size) 0)
+ (when (zerop (buffer-size))
(error
"Error: nix edit failed to produce any output"))
(setq result (substring (buffer-string) 0 (- (buffer-size) 1))))
diff --git a/nix-format.el b/nix-format.el
index b478a1c687..db58002a69 100644
--- a/nix-format.el
+++ b/nix-format.el
@@ -13,14 +13,13 @@
:group 'nix
:type 'string)
-(if (fboundp 'replace-buffer-contents)
- (defun nix--replace-buffer-contents (src dst)
- (with-current-buffer dst (replace-buffer-contents src)))
- (defun nix--replace-buffer-contents (src dst)
- (if (not (string= (with-current-buffer src (buffer-string))
- (with-current-buffer dst (buffer-string))))
- (with-current-buffer src
- (copy-to-buffer dst (point-min) (point-max))))))
+(defun nix--replace-buffer-contents (src dst)
+ (if (fboundp 'replace-buffer-contents)
+ (with-current-buffer dst (replace-buffer-contents src))
+ (unless (string= (with-current-buffer src (buffer-string))
+ (with-current-buffer dst (buffer-string)))
+ (with-current-buffer src
+ (copy-to-buffer dst (point-min) (point-max))))))
(defun nix--format-call (buf nixfmt-bin)
"Format BUF using nixfmt."
diff --git a/nix-search.el b/nix-search.el
index afcc127057..dacc5f09d1 100644
--- a/nix-search.el
+++ b/nix-search.el
@@ -20,7 +20,7 @@
(nix--process-json-nocheck "search" "--json"
(unless use-flakes "--file") file
(when no-cache "--no-cache")
- (unless (string= "" search) search)))
+ (unless (string-empty-p search) search)))
(defface nix-search-pname
'((t :height 1.5
diff --git a/nix-store.el b/nix-store.el
index 4fac3ffb67..2668246751 100644
--- a/nix-store.el
+++ b/nix-store.el
@@ -22,8 +22,9 @@
:group 'nix)
(defcustom nix-store-path-omit-self t
- "Do not list the current entry itself within sections of
nix-store-path-mode."
- :package-version '(nix-mode . "1.6.0"))
+ "Do not list the current entry itself within sections of
`nix-store-path-mode'."
+ :package-version '(nix-mode . "1.6.0")
+ :type 'boolean)
(defun nix-store-realise (path)
"Realise a path asynchronously.