From 4e6be18b82a4f099e72cd4d3f24c2150ff679c39 Mon Sep 17 00:00:00 2001 From: ueno Date: Wed, 3 Nov 1999 13:01:50 +0000 Subject: [PATCH] * pgg-gpg.el (snarf-keys-region): Add `-' as extra argument of gpg --import; convert status code into an integer. --- pgg-gpg.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pgg-gpg.el b/pgg-gpg.el index e093301..55e6d7b 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -244,7 +244,7 @@ (luna-define-method snarf-keys-region ((scheme pgg-scheme-gpg) start end) - (let ((args '("--import" "--batch")) status) + (let ((args '("--import" "--batch" "-")) status) (pgg-gpg-process-region start end nil pgg-gpg-program args) (set-buffer pgg-status-buffer) (goto-char (point-min)) @@ -252,18 +252,20 @@ (setq status (buffer-substring (match-end 0) (progn (end-of-line) (point))) - status (vconcat (split-string status))) + status (vconcat (mapcar #'string-to-int + (split-string status)))) (erase-buffer) - (insert (aref status 0) "keys seen\n" - (format "\t%d bad, %d new, %d old\n" - (string-to-int (aref status 1)) - (+ (string-to-int (aref status 2)) - (string-to-int (aref status 10))) - (+ (string-to-int (aref status 4)) - (string-to-int (aref status 11)))) + (insert (format "Imported %d key(s). +\tArmor contains %d key(s) [%d bad, %d old].\n" + (+ (aref status 2) + (aref status 10)) + (aref status 0) + (aref status 1) + (+ (aref status 4) + (aref status 11))) (if (zerop (aref status 9)) "" - "\tSecret keys are imported\n"))) + "\tSecret keys are imported.\n"))) (append-to-buffer pgg-output-buffer (point-min)(point-max)) (with-current-buffer pgg-output-buffer -- 1.7.10.4