Skip to content

Commit 8a5c9d3

Browse files
authored
Merge pull request #183 from nagy/compiler-warnings
Fix some compiler warnings
2 parents 43bb31e + 56783d7 commit 8a5c9d3

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
with:
1919
nix_path: nixpkgs=channel:${{ matrix.nixpkgs_channel }}
2020
#- run: nix build
21-
- run: nix-build -E '(import ./.).defaultPackage.${builtins.currentSystem}'
21+
- run: nix-build -E '(import ./.).packages.${builtins.currentSystem}'
2222
#- run: nix flake check
2323
- run: nix-build -E '(import ./.).checks.${builtins.currentSystem}'

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.PHONY: test clean install run
22

3-
ELS = nix.el nix-company.el nix-drv-mode.el nix-format.el \
3+
ELS = nix.el nix-company.el nix-drv-mode.el nix-flake.el nix-format.el \
44
nix-instantiate.el nix-mode.el nix-mode-mmm.el \
55
nix-prettify-mode.el nix-repl.el nix-search.el nix-shebang.el \
66
nix-shell.el nix-store.el
77
ELCS = $(ELS:.el=.elc)
88

9+
DOCS = nix-mode.pdf nix-mode.html nix-mode.info
10+
911
TESTS = tests/nix-mode-tests.el tests/nix-font-lock-tests.el
1012

1113
DESTDIR =

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+4-7
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
99
in {
1010
packages = forAllSystems (system: with (import nixpkgs { inherit system; }); {
11-
nix-mode = let
11+
default = let
1212
emacs = emacsWithPackages (epkgs: with epkgs; [
13-
org-plus-contrib
13+
org-contrib
1414
company
1515
mmm-mode
16-
f
1716
magit-section
1817
transient
1918
]);
20-
in stdenvNoCC.mkDerivation {
19+
in stdenv.mkDerivation {
2120
pname = "nix-mode";
2221
version = "1.5.0";
2322
src = self;
@@ -31,12 +30,10 @@
3130
};
3231
});
3332

34-
defaultPackage = forAllSystems (system: self.packages.${system}.nix-mode);
35-
3633
# checks are run in ‘make check’ right now we should probably move
3734
# these to its own derivation
3835
checks = forAllSystems (system: {
39-
inherit (self.packages.${system}) nix-mode;
36+
inherit (self.packages.${system}) default;
4037
});
4138
};
4239
}

nix-edit.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ATTR the attribute to find in nix expressions."
2727
(call-process nix-executable nil (list stdout nil) nil
2828
"edit" "-f" file attr)
2929
(with-current-buffer stdout
30-
(when (eq (buffer-size) 0)
30+
(when (zerop (buffer-size))
3131
(error
3232
"Error: nix edit failed to produce any output"))
3333
(setq result (substring (buffer-string) 0 (- (buffer-size) 1))))

nix-format.el

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
:group 'nix
1414
:type 'string)
1515

16-
(if (fboundp 'replace-buffer-contents)
17-
(defun nix--replace-buffer-contents (src dst)
18-
(with-current-buffer dst (replace-buffer-contents src)))
19-
(defun nix--replace-buffer-contents (src dst)
20-
(if (not (string= (with-current-buffer src (buffer-string))
21-
(with-current-buffer dst (buffer-string))))
22-
(with-current-buffer src
23-
(copy-to-buffer dst (point-min) (point-max))))))
16+
(defun nix--replace-buffer-contents (src dst)
17+
(if (fboundp 'replace-buffer-contents)
18+
(with-current-buffer dst (replace-buffer-contents src))
19+
(unless (string= (with-current-buffer src (buffer-string))
20+
(with-current-buffer dst (buffer-string)))
21+
(with-current-buffer src
22+
(copy-to-buffer dst (point-min) (point-max))))))
2423

2524
(defun nix--format-call (buf nixfmt-bin)
2625
"Format BUF using nixfmt."

nix-search.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(nix--process-json-nocheck "search" "--json"
2121
(unless use-flakes "--file") file
2222
(when no-cache "--no-cache")
23-
(unless (string= "" search) search)))
23+
(unless (string-empty-p search) search)))
2424

2525
(defface nix-search-pname
2626
'((t :height 1.5

nix-store.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
:group 'nix)
2323

2424
(defcustom nix-store-path-omit-self t
25-
"Do not list the current entry itself within sections of nix-store-path-mode."
26-
:package-version '(nix-mode . "1.6.0"))
25+
"Do not list the current entry itself within sections of `nix-store-path-mode'."
26+
:package-version '(nix-mode . "1.6.0")
27+
:type 'boolean)
2728

2829
(defun nix-store-realise (path)
2930
"Realise a path asynchronously.

0 commit comments

Comments
 (0)