From 20ead3b031ff14a7f25a44101602b8554f1ab542 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 19 Dec 2006 08:48:35 +0000 Subject: [PATCH] * epa.el (epa-import-keys-region): New command. --- ChangeLog | 1 + epa.el | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index dc1ff3e..6ec0cba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * epa.el (epa-sign-region): --armor & --textmode. (epa-encrypt-region): Ditto. + (epa-import-keys-region): New command. (epa-insert-keys): New command. (epa--insert-keys): Renamed from epa-insert-keys. diff --git a/epa.el b/epa.el index c59706b..b9c55d2 100644 --- a/epa.el +++ b/epa.el @@ -897,6 +897,24 @@ Don't use this command in Lisp programs!" (apply #'epa-list-keys epa-list-keys-arguments)))) ;;;###autoload +(defun epa-import-keys-region (start end) + "Import keys from the region. + +Don't use this command in Lisp programs!" + (interactive "r") + (let ((context (epg-make-context))) + (message "Importing...") + (condition-case nil + (progn + (epg-import-keys-from-string context (buffer-substring start end)) + (message "Importing...done")) + (error + (message "Importing...failed"))) + (if (epg-context-result-for context 'import) + (epa-display-info (epg-import-result-to-string + (epg-context-result-for context 'import)))))) + +;;;###autoload (defun epa-export-keys (keys file) "Export selected KEYS to FILE. -- 1.7.10.4