GNU bug report logs - #41271
[PATCH 7/9] Cosmetic changes to epa libraries

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Thu, 14 May 2020 19:14:04 UTC

Severity: normal

Tags: patch

Merged with 41268, 41269, 41270, 41272, 41273, 41274, 41275, 41276, 41277

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41271 in the body.
You can then email your comments to 41271 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41271; Package emacs. (Thu, 14 May 2020 19:14:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonas Bernoulli <jonas <at> bernoul.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 May 2020 19:14:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH 7/9] Cosmetic changes to epa libraries
Date: Thu, 14 May 2020 21:13:23 +0200
* 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.
---
 lisp/epa-dired.el | 44 ++++++++++++++++++--------------------------
 lisp/epa-file.el  |  4 ++--
 2 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el
index 1bcfb758ed..4ff1ba3394 100644
--- a/lisp/epa-dired.el
+++ b/lisp/epa-dired.el
@@ -30,48 +30,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)
 
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 3e23c09a51..de51c59c34 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -66,8 +66,8 @@ epa-file-passphrase-callback-function
 	  (or (copy-sequence (cdr entry))
 	      (progn
 		(unless entry
-		  (setq entry (list file)
-			epa-file-passphrase-alist
+		  (setq entry (list file))
+		  (setq epa-file-passphrase-alist
 			(cons entry
 			      epa-file-passphrase-alist)))
 		(setq passphrase (epa-passphrase-callback-function context
-- 
2.26.0





Forcibly Merged 41268 41269 41270 41271 41276. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 41268 41269 41270 41271 41272 41276. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:03 GMT) Full text and rfc822 format available.

Forcibly Merged 41268 41269 41270 41271 41272 41273 41276. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:03 GMT) Full text and rfc822 format available.

Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41276. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:03 GMT) Full text and rfc822 format available.

Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41275 41276. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:04 GMT) Full text and rfc822 format available.

Forcibly Merged 41268 41269 41270 41271 41272 41273 41274 41275 41276 41277. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 May 2020 22:14:04 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 41276 <at> debbugs.gnu.org and Jonas Bernoulli <jonas <at> bernoul.li> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 06 Aug 2020 07:27:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Sep 2020 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.