From 002f4d913f2d35669126018caba175e3268bd62d Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 2 May 2006 07:44:45 +0000 Subject: [PATCH] * epg.el (epg-list-keys-postprocess-one-key): Abolished. (epg-list-keys): Reverse all keys, sub-keys, user-ids, and key signatures by itself. --- ChangeLog | 3 +++ epg.el | 41 +++++++++++++++++------------------------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5072f2f..4828071 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * epg.el (epg-make-key-signature): New object epg-key-signature. (epg-list-keys): Collect key signatures. (epg-make-sub-key): Renamed secret -> secret-p. + (epg-list-keys-postprocess-one-key): Abolished. + (epg-list-keys): Reverse all keys, sub-keys, user-ids, and key + signatures by itself. 2006-05-01 Daiki Ueno diff --git a/epg.el b/epg.el index aa06274..2855958 100644 --- a/epg.el +++ b/epg.el @@ -1336,24 +1336,6 @@ This function is for internal use only." (aref line 5) (aref line 6))) -(defun epg-list-keys-postprocess-one-key (key) - (let (key-id user-id-string entry) - (epg-key-set-sub-key-list - key - (nreverse (epg-key-sub-key-list key))) - (epg-key-set-user-id-list - key - (nreverse (epg-key-user-id-list key))) - (setq key-id - (epg-sub-key-id (car (epg-key-sub-key-list key))) - user-id-string - (epg-user-id-string (car (epg-key-user-id-list key))) - entry (assoc key-id epg-user-id-alist)) - (if entry - (setcdr entry user-id-string) - (setq epg-user-id-alist (cons (cons key-id user-id-string) - epg-user-id-alist))))) - ;;;###autoload (defun epg-list-keys (context &optional name mode) "Return a list of epg-key objects matched with NAME. @@ -1362,12 +1344,10 @@ If MODE is t or 'secret, only secret keyring should be searched. Otherwise, only public keyring should be searched and the key signatures should be included." (let ((lines (epg-list-keys-1 context name mode)) - keys cert) + keys cert pointer pointer-1) (while lines (cond ((member (aref (car lines) 0) '("pub" "sec" "crt" "crs")) - (if (car keys) - (epg-list-keys-postprocess-one-key (car keys))) (setq cert (member (aref (car lines) 0) '("crt" "crs")) keys (cons (epg-make-key (if (aref (car lines) 8) @@ -1417,9 +1397,22 @@ signatures should be included." (epg-user-id-signature-list (car (epg-key-user-id-list (car keys)))))))) (setq lines (cdr lines))) - (if (car keys) - (epg-list-keys-postprocess-one-key (car keys))) - (nreverse keys))) + (setq keys (nreverse keys) + pointer keys) + (while pointer + (epg-key-set-sub-key-list + (car pointer) + (nreverse (epg-key-sub-key-list (car pointer)))) + (setq pointer-1 (epg-key-set-user-id-list + (car pointer) + (nreverse (epg-key-user-id-list (car pointer))))) + (while pointer-1 + (epg-user-id-set-signature-list + (car pointer-1) + (nreverse (epg-user-id-signature-list (car pointer-1)))) + (setq pointer-1 (cdr pointer-1))) + (setq pointer (cdr pointer))) + keys)) (if (fboundp 'make-temp-file) (defalias 'epg-make-temp-file 'make-temp-file) -- 1.7.10.4