Skip to content

Commit f43d481

Browse files
committed
Fix mostly some compiler warnings
1 parent 43bb31e commit f43d481

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

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 =

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)