[PATCH] emacs: Group similar expressions together

Niall Dooley dooleyn at gmail.com
Mon Nov 27 14:38:14 UTC 2023


Variables, functions and commands.
---
 contrib/emacs/password-store.el | 36 ++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 280aee5..3843f22 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -63,6 +63,9 @@
   (executable-find "pass")
   "Pass executable.")
 
+(defvar password-store-kill-ring-pointer nil
+  "The tail of of the kill ring ring whose car is the password.")
+
 (defvar password-store-timeout-timer nil
   "Timer for clearing clipboard.")
 
@@ -176,9 +179,6 @@ Nil arguments are ignored.  Output is discarded."
 (defun password-store--run-version ()
   (password-store--run "version"))
 
-(defvar password-store-kill-ring-pointer nil
-  "The tail of of the kill ring ring whose car is the password.")
-
 (defun password-store-dir ()
   "Return password store directory."
   (or (bound-and-true-p auth-source-pass-filename)
@@ -193,6 +193,15 @@ Nil arguments are ignored.  Output is discarded."
   "Return entry name corresponding to FILE."
   (file-name-sans-extension (file-relative-name file (password-store-dir))))
 
+(defun password-store-list (&optional subdir)
+  "List password entries under SUBDIR."
+  (unless subdir (setq subdir ""))
+  (let ((dir (expand-file-name subdir (password-store-dir))))
+    (if (file-directory-p dir)
+        (delete-dups
+         (mapcar 'password-store--file-to-entry
+                 (directory-files-recursively dir ".+\\.gpg\\'"))))))
+
 (defun password-store--completing-read (&optional require-match)
   "Read a password entry in the minibuffer, with completion.
 
@@ -211,21 +220,6 @@ ENTRY is the name of a password-store entry."
          (valid-fields (mapcar #'car (password-store-parse-entry entry))))
     (completing-read "Field: " valid-fields nil 'match)))
 
-(defun password-store-list (&optional subdir)
-  "List password entries under SUBDIR."
-  (unless subdir (setq subdir ""))
-  (let ((dir (expand-file-name subdir (password-store-dir))))
-    (if (file-directory-p dir)
-        (delete-dups
-         (mapcar 'password-store--file-to-entry
-                 (directory-files-recursively dir ".+\\.gpg\\'"))))))
-
-;;;###autoload
-(defun password-store-edit (entry)
-  "Edit password for ENTRY."
-  (interactive (list (password-store--completing-read t)))
-  (password-store--run-edit entry))
-
 ;;;###autoload
 (defun password-store-get (entry &optional callback)
   "Return password for ENTRY.
@@ -336,6 +330,12 @@ Separate multiple IDs with spaces."
       (message "Cannot insert entry for %s" entry))
     nil))
 
+;;;###autoload
+(defun password-store-edit (entry)
+  "Edit password for ENTRY."
+  (interactive (list (password-store--completing-read t)))
+  (password-store--run-edit entry))
+
 ;;;###autoload
 (defun password-store-generate (entry &optional password-length)
   "Generate a new password for ENTRY with PASSWORD-LENGTH.
-- 
2.30.2



More information about the Password-Store mailing list