From 2527d6021e08a02b6575effebd57c5d452fdf11d Mon Sep 17 00:00:00 2001 From: ueno Date: Thu, 19 Apr 2007 04:53:43 +0000 Subject: [PATCH] * epa-file.el (epa-file-insert-file-contents): Guess the value of epa-file-encrypt-to from 'encrypted-to context-result. * epg.el (epg--status-ENC_TO): New function. --- ChangeLog | 6 ++++++ epa-file.el | 3 +++ epg.el | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index b8af488..ffef65e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-19 Daiki Ueno + + * epa-file.el (epa-file-insert-file-contents): Guess the value of + epa-file-encrypt-to from 'encrypted-to context-result. + * epg.el (epg--status-ENC_TO): New function. + 2007-04-04 Daiki Ueno Chris Moore diff --git a/epa-file.el b/epa-file.el index 777a1a9..68f9801 100644 --- a/epa-file.el +++ b/epa-file.el @@ -164,6 +164,9 @@ May either be a string or a list of strings.") (setcdr entry nil)) (signal 'file-error (cons "Opening input file" (cdr error))))) + (make-local-variable 'epa-file-encrypt-to) + (setq epa-file-encrypt-to + (mapcar #'car (epg-context-result-for context 'encrypted-to))) (if (or beg end) (setq string (substring string (or beg 0) end))) (save-excursion diff --git a/epg.el b/epg.el index 7993b48..914da2b 100644 --- a/epg.el +++ b/epg.el @@ -1491,6 +1491,15 @@ This function is for internal use only." (if (consp (epg-context-progress-callback context)) (cdr (epg-context-progress-callback context)))))) +(defun epg--status-ENC_TO (context string) + (if (string-match "\\`\\([0-9A-Za-z]+\\) \\([0-9]+\\) \\([0-9]+\\)" string) + (epg-context-set-result-for + context 'encrypted-to + (cons (list (match-string 1 string) + (string-to-number (match-string 2 string)) + (string-to-number (match-string 3 string))) + (epg-context-result-for context 'encrypted-to))))) + (defun epg--status-DECRYPTION_FAILED (context string) (epg-context-set-result-for context 'decryption-failed t)) -- 1.7.10.4