* gnus.el (gnus-update-message-archive-method): New variable.
[gnus] / lisp / pgg-gpg.el
index 293431b..d34ee2d 100644 (file)
@@ -1,7 +1,7 @@
 ;;; pgg-gpg.el --- GnuPG support for PGG.
 
 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Symmetric encryption support added by: Sascha Wilde <wilde@sha-bang.de>
@@ -50,7 +50,7 @@
   :type '(choice (const :tag "New `--recipient' option" "--recipient")
                 (const :tag "Old `--remote-user' option" "--remote-user")))
 
-(defcustom pgg-gpg-use-agent nil
+(defcustom pgg-gpg-use-agent t
   "Whether to use gnupg agent for key caching."
   :group 'pgg-gpg
   :type 'boolean)
          (save-excursion
            (if (looking-at "\\[GNUPG:] \\([A-Z_]+\\)\\>.*")
                (let* ((status (match-string 1))
-                      (symbol (intern-soft (concat "pgg-gpg-status-" status)))
-                      (entry (member status pgg-gpg-pending-status-list)))
-                 (if entry
-                     (setq pgg-gpg-pending-status-list
-                           (delq (car entry)
-                                 pgg-gpg-pending-status-list)))
+                      (symbol (intern-soft (concat "pgg-gpg-status-"
+                                                   status))))
+                 (if (member status pgg-gpg-pending-status-list)
+                     (setq pgg-gpg-pending-status-list nil))
                  (if (and symbol
                           (fboundp symbol))
                      (funcall symbol process (buffer-substring
@@ -247,7 +245,7 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt."
           '("--armor" "--always-trust" "--encrypt")
           (if pgg-text-mode '("--textmode"))
           (if sign (list "--sign" "--local-user" pgg-gpg-user-id))
-          (if recipients
+          (if (or recipients pgg-encrypt-for-me)
               (apply #'nconc
                      (mapcar (lambda (rcpt)
                                (list pgg-gpg-recipient-argument rcpt))
@@ -256,7 +254,7 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt."
                                          (list pgg-gpg-user-id))))))))
         (process (pgg-gpg-start-process args)))
     (if (and sign (not pgg-gpg-use-agent))
-       (pgg-gpg-wait-for-status process '("GOOD_PASSPHRASE")))
+       (pgg-gpg-wait-for-status process '("BEGIN_SIGNING" "GOOD_PASSPHRASE")))
     (process-send-region process start end)
     (pgg-gpg-wait-for-completion process)
     (save-excursion
@@ -303,7 +301,7 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt."
                  (if pgg-text-mode '("--textmode"))))
         (process (pgg-gpg-start-process args)))
     (unless pgg-gpg-use-agent
-      (pgg-gpg-wait-for-status process '("GOOD_PASSPHRASE")))
+      (pgg-gpg-wait-for-status process '("BEGIN_SIGNING" "GOOD_PASSPHRASE")))
     (process-send-region process start end)
     (pgg-gpg-wait-for-completion process)
     (save-excursion