Add IMAP-specific user and password prompt.
authorTed Zlatanov <tzz@lifelogs.com>
Tue, 8 Mar 2011 19:44:08 +0000 (13:44 -0600)
committerTed Zlatanov <tzz@lifelogs.com>
Tue, 8 Mar 2011 19:44:08 +0000 (13:44 -0600)
* nnimap.el (nnimap-credentials): Add IMAP-specific user and password prompt.

lisp/ChangeLog
lisp/nnimap.el

index 238f091..7b44768 100644 (file)
@@ -3,6 +3,7 @@
        * nnimap.el (nnimap-credentials): Keep the :save-function as the third
        parameter in the credentials.
        (nnimap-open-connection-1): Use it after a successful login.
+       (nnimap-credentials): Add IMAP-specific user and password prompt.
 
        * auth-source.el (auth-source-search): Add :require parameter, taking a
        list.  Document it and the :save-function return token.  Pass :require
index 998f504..e76ead5 100644 (file)
@@ -279,11 +279,14 @@ textual parts.")
     (current-buffer)))
 
 (defun nnimap-credentials (address ports)
-  (let ((found (nth 0 (auth-source-search :max 1
-                                         :host address
-                                         :port ports
-                                         :require '(:user :secret)
-                                         :create t))))
+  (let* ((auth-source-creation-prompts
+          '((user  . "IMAP user at %h: ")
+            (secret . "IMAP password for %u@%h: ")))
+         (found (nth 0 (auth-source-search :max 1
+                                           :host address
+                                           :port ports
+                                           :require '(:user :secret)
+                                           :create t))))
     (if found
         (list (plist-get found :user)
              (let ((secret (plist-get found :secret)))