From 47f8d950c58949733862813f29856480a9e232c7 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 6 Sep 2022 20:50:35 +0200 Subject: emacs: Add command password-store-generate-no-symbols This command generates a new password not including symbols. Suggested by Aner Zakobar : https://lists.zx2c4.com/pipermail/password-store/2022-August/004638.html --- contrib/emacs/password-store.el | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'contrib/emacs/password-store.el') diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index 1d23090..6561eb1 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -342,12 +342,31 @@ Separate multiple IDs with spaces." Default PASSWORD-LENGTH is `password-store-password-length'." (interactive (list (password-store--completing-read) - (when current-prefix-arg - (abs (prefix-numeric-value current-prefix-arg))))) - (unless password-length (setq password-length password-store-password-length)) + (and current-prefix-arg + (abs (prefix-numeric-value current-prefix-arg))))) ;; A message with the output of the command is not printed because ;; the output contains the password. - (password-store--run-generate entry password-length t) + (password-store--run-generate + entry + (or password-length password-store-password-length) + 'force) + nil) + +;;;###autoload +(defun password-store-generate-no-symbols (entry &optional password-length) + "Generate a new password without symbols for ENTRY with PASSWORD-LENGTH. + +Default PASSWORD-LENGTH is `password-store-password-length'." + (interactive (list (password-store--completing-read) + (and current-prefix-arg + (abs (prefix-numeric-value current-prefix-arg))))) + + ;; A message with the output of the command is not printed because + ;; the output contains the password. + (password-store--run-generate + entry + (or password-length password-store-password-length) + 'force 'no-symbols) nil) ;;;###autoload -- cgit v1.2.3