(imap-store-password): New variable.
authorReiner Steib <Reiner.Steib@gmx.de>
Fri, 12 Mar 2004 19:16:59 +0000 (19:16 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Fri, 12 Mar 2004 19:16:59 +0000 (19:16 +0000)
(imap-interactive-login): Use it.
Suggested by Mark Plaksin <happy@mcplaksin.org>.

lisp/ChangeLog
lisp/imap.el

index 7919fea..64e6dbe 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-12  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * imap.el (imap-store-password): New variable.
+       (imap-interactive-login): Use it.
+       Suggested by Mark Plaksin <happy@mcplaksin.org>.
+
 2004-03-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-read-summary-keys): Restore new
 2004-03-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-read-summary-keys): Restore new
index 1e6ef0d..cca272a 100644 (file)
@@ -258,6 +258,11 @@ Shorter values mean quicker response, but is more CPU intensive."
   :type 'number
   :group 'imap)
 
   :type 'number
   :group 'imap)
 
+(defcustom imap-store-password nil
+  "If non-nil, store session password without promting."
+  :group 'imap
+  :type 'boolean)
+
 ;; Various variables.
 
 (defvar imap-fetch-data-hook nil
 ;; Various variables.
 
 (defvar imap-fetch-data-hook nil
@@ -820,9 +825,10 @@ Returns t if login was successful, nil otherwise."
              (progn
                (setq ret t
                      imap-username user)
              (progn
                (setq ret t
                      imap-username user)
-               (if (and (not imap-password)
-                        (y-or-n-p "Store password for this session? "))
-                   (setq imap-password passwd)))
+               (when (and (not imap-password)
+                          (or imap-store-password
+                              (y-or-n-p "Store password for this session? ")))
+                 (setq imap-password passwd)))
            (message "Login failed...")
            (setq passwd nil)
            (setq imap-password nil)
            (message "Login failed...")
            (setq passwd nil)
            (setq imap-password nil)