[PATCH] Satisfy Emacs byte-compiler

Roni Kallio roni at kallio.app
Wed Oct 20 12:23:45 UTC 2021


Motivation for the patch: Get the byte-compiler to shut up when
native-compiling third party elisp packages.

For unused lexical variable warnings: prepend the variable with _, or
remove in case the variable is truly unnecessary.

For docstring width warnings: reflow the docstring.

The patch fixes the following warnings in the output of
`byte-compile-file`:

In password-store--run-1:
password-store.el:87:31: Warning: Unused lexical argument `process'

In password-store--run:
password-store.el:105:18: Warning: Unused lexical variable `slept-for'

In password-store--run-list:
password-store.el:125:44: Warning: Unused lexical argument `subdir'

In password-store--run-grep:
password-store.el:128:44: Warning: Unused lexical argument `string'

In password-store--run-find:
password-store.el:131:44: Warning: Unused lexical argument `string'

In password-store--run-insert:
password-store.el:139:61: Warning: Unused lexical argument `entry'
password-store.el:139:61: Warning: Unused lexical argument `password'
password-store.el:139:61: Warning: Unused lexical argument `force'

In password-store-get-field:
password-store.el:242:8: Warning: docstring wider than 80 characters

In password-store-copy-field:
password-store.el:299:8: Warning: docstring wider than 80 characters
---
 contrib/emacs/password-store.el | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 61c339e..d489a8a 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -84,7 +84,7 @@ or outputs error message on failure."
      :command (cons password-store-executable (delq nil args))
      :connection-type 'pipe
      :noquery t
-     :filter (lambda (process text)
+     :filter (lambda (_process text)
                (setq output (concat output text)))
      :sentinel (lambda (process state)
                  (cond
@@ -98,8 +98,7 @@ or outputs error message on failure."

 Nil arguments are ignored.  Returns the output on success, or
 outputs error message on failure."
-  (let ((output nil)
-        (slept-for 0))
+  (let ((output nil))
     (apply #'password-store--run-1 (lambda (password)
                                      (setq output password))
            (delq nil args))
@@ -122,13 +121,13 @@ Nil arguments are ignored.  Output is discarded."
          (if folder (format "--path=%s" folder))
          gpg-ids))

-(defun password-store--run-list (&optional subdir)
+(defun password-store--run-list (&optional _subdir)
   (error "Not implemented"))

-(defun password-store--run-grep (&optional string)
+(defun password-store--run-grep (&optional _string)
   (error "Not implemented"))

-(defun password-store--run-find (&optional string)
+(defun password-store--run-find (&optional _string)
   (error "Not implemented"))

 (defun password-store--run-show (entry &optional callback)
@@ -136,7 +135,7 @@ Nil arguments are ignored.  Output is discarded."
       (password-store--run-1 callback "show" entry)
     (password-store--run "show" entry)))

-(defun password-store--run-insert (entry password &optional force)
+(defun password-store--run-insert (_entry _password &optional _force)
   (error "Not implemented"))

 (defun password-store--run-edit (entry)
@@ -241,9 +240,13 @@ When CALLBACK is non-`NIL', call CALLBACK with the first line instead."
 ;;;###autoload
 (defun password-store-get-field (entry field &optional callback)
   "Return FIELD for ENTRY.
-FIELD is a string, for instance \"url\".
-When CALLBACK is non-`NIL', call it with the line associated to FIELD instead.
-If FIELD equals to symbol secret, then this function reduces to `password-store-get'."
+FIELD is a string, for instance \"url\".
+
+When CALLBACK is non-`NIL', call it with the line associated to
+FIELD instead.
+
+If FIELD equals to symbol secret, then this function reduces to
+`password-store-get'."
   (let* ((inhibit-message t)
          (secret (auth-source-pass-get field entry)))
     (if (not callback) secret
@@ -302,7 +305,9 @@ after `password-store-time-before-clipboard-restore' seconds."
 Clear previous secret from the kill ring.  Pointer to the kill ring is
 stored in `password-store-kill-ring-pointer'.  Secret field is cleared
 after `password-store-timeout' seconds.
-If FIELD equals to symbol secret, then this function reduces to `password-store-copy'."
+
+If FIELD equals to symbol secret, then this function reduces to
+`password-store-copy'."
   (interactive
    (let ((entry (password-store--completing-read)))
      (list entry (password-store-read-field entry))))
--
Roni Kallio


More information about the Password-Store mailing list