diff options
author | Jonas Bernoulli <jonas@bernoul.li> | 2020-02-18 16:56:16 +0100 |
---|---|---|
committer | Jonas Bernoulli <jonas@bernoul.li> | 2020-07-15 18:06:04 +0200 |
commit | 9f82622d33b7e7558d1ba30781b209b599b24b52 (patch) | |
tree | 8692ffe0f302bfac9825861f9cb679711a1d3807 /lisp/epa-dired.el | |
parent | e78c15acf679259caea6566446f61966cea032aa (diff) | |
download | emacs-9f82622d33b7e7558d1ba30781b209b599b24b52.tar.gz emacs-9f82622d33b7e7558d1ba30781b209b599b24b52.tar.bz2 emacs-9f82622d33b7e7558d1ba30781b209b599b24b52.zip |
Cosmetic changes to epa libraries
These changes make the code more readable.
* lisp/epa-dired.el (epa-dired-do-decrypt, epa-dired-do-verify)
(epa-dired-do-sign, epa-dired-do-encrypt): Use dolist instead
of while.
* lisp/epa-file.el (epa-file-passphrase-callback-function):
Set just one variable per setq call.
Diffstat (limited to 'lisp/epa-dired.el')
-rw-r--r-- | lisp/epa-dired.el | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el index f601d426566..9269ea97070 100644 --- a/lisp/epa-dired.el +++ b/lisp/epa-dired.el @@ -29,48 +29,40 @@ (defun epa-dired-do-decrypt () "Decrypt marked files." (interactive) - (let ((file-list (dired-get-marked-files))) - (while file-list - (epa-decrypt-file (expand-file-name (car file-list))) - (setq file-list (cdr file-list))) - (revert-buffer))) + (dolist (file (dired-get-marked-files)) + (epa-decrypt-file (expand-file-name file))) + (revert-buffer)) ;;;###autoload (defun epa-dired-do-verify () "Verify marked files." (interactive) - (let ((file-list (dired-get-marked-files))) - (while file-list - (epa-verify-file (expand-file-name (car file-list))) - (setq file-list (cdr file-list))))) + (dolist (file (dired-get-marked-files)) + (epa-verify-file (expand-file-name file)))) ;;;###autoload (defun epa-dired-do-sign () "Sign marked files." (interactive) - (let ((file-list (dired-get-marked-files))) - (while file-list - (epa-sign-file - (expand-file-name (car file-list)) - (epa-select-keys (epg-make-context) "Select keys for signing. + (dolist (file (dired-get-marked-files)) + (epa-sign-file + (expand-file-name file) + (epa-select-keys (epg-make-context) "Select keys for signing. If no one is selected, default secret key is used. " - nil t) - (y-or-n-p "Make a detached signature? ")) - (setq file-list (cdr file-list))) - (revert-buffer))) + nil t) + (y-or-n-p "Make a detached signature? "))) + (revert-buffer)) ;;;###autoload (defun epa-dired-do-encrypt () "Encrypt marked files." (interactive) - (let ((file-list (dired-get-marked-files))) - (while file-list - (epa-encrypt-file - (expand-file-name (car file-list)) - (epa-select-keys (epg-make-context) "Select recipients for encryption. -If no one is selected, symmetric encryption will be performed. ")) - (setq file-list (cdr file-list))) - (revert-buffer))) + (dolist (file (dired-get-marked-files)) + (epa-encrypt-file + (expand-file-name file) + (epa-select-keys (epg-make-context) "Select recipients for encryption. +If no one is selected, symmetric encryption will be performed. "))) + (revert-buffer)) (provide 'epa-dired) |