From: ueno Date: Tue, 19 Dec 2006 08:48:35 +0000 (+0000) Subject: * epa.el (epa-import-keys-region): New command. X-Git-Tag: epg-0_0_9~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=20ead3b031ff14a7f25a44101602b8554f1ab542;p=elisp%2Fepg.git * epa.el (epa-import-keys-region): New command. --- 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.