emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode f43d481fc7 1/4: Fix mostly some compiler warnings


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode f43d481fc7 1/4: Fix mostly some compiler warnings
Date: Wed, 29 Mar 2023 16:00:06 -0400 (EDT)

branch: elpa/nix-mode
commit f43d481fc703335ffc6667267f344cebfd05f80f
Author: Daniel Nagy <danielnagy@posteo.de>
Commit: Daniel Nagy <danielnagy@posteo.de>

    Fix mostly some compiler warnings
---
 Makefile      |  4 +++-
 nix-edit.el   |  2 +-
 nix-format.el | 15 +++++++--------
 nix-search.el |  2 +-
 nix-store.el  |  5 +++--
 5 files changed, 15 insertions(+), 13 deletions(-)

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/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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]