OSDN Git Service

* epa-file.el (epa-file-insert-file-contents): Guess the value of
authorDaiki Ueno <ueno@unixuser.org>
Thu, 19 Apr 2007 04:53:43 +0000 (04:53 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Thu, 19 Apr 2007 04:53:43 +0000 (04:53 +0000)
epa-file-encrypt-to from 'encrypted-to context-result.
* epg.el (epg--status-ENC_TO): New function.

ChangeLog
epa-file.el
epg.el

index b8af488..ffef65e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-19  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
            Chris Moore <dooglus@users.sourceforge.jp>
 
index 777a1a9..68f9801 100644 (file)
@@ -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 (file)
--- 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))