In the password prompt, say what we're querying for.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 01:12:41 +0000 (03:12 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 01:12:41 +0000 (03:12 +0200)
Also prompt for user name if that hasn't been given.

lisp/ChangeLog
lisp/auth-source.el

index 46b9003..4268e13 100644 (file)
@@ -1,5 +1,9 @@
 2010-09-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * auth-source.el (auth-source-create): In the password prompt, say what
+       we're querying for.  Also prompt for user name if that hasn't been
+       given.
+
        * nnimap.el (nnimap-with-process-buffer): Removed.
 
 2010-09-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
index a86d8d8..a0be0ca 100644 (file)
@@ -312,20 +312,23 @@ Return structure as specified by MODE."
     (setq result
          (mapcar
           (lambda (m)
-            (if (equal "password" m)
-                (let ((passwd (read-passwd "Password: ")))
-                  (cond
-                   ;; Secret Service API.
-                   ((consp source)
-                    (apply
-                     'secrets-create-item
-                     (auth-get-source entry) name passwd spec))
-                   (t)) ;; netrc not implemented yes.
-                  passwd)
-              (or
-               ;; the originally requested :user
-               user
-               "unknown-user")))
+            (cond
+             ((equal "password" m)
+              (let ((passwd (read-passwd
+                             (format "Password for %s on %s: " prot host))))
+                (cond
+                 ;; Secret Service API.
+                 ((consp source)
+                  (apply
+                   'secrets-create-item
+                   (auth-get-source entry) name passwd spec))
+                 (t)) ;; netrc not implemented yes.
+                passwd))
+             ((equal "login" m)
+              (or user
+                  (read-string (format "User name for %s on %s: " prot host))))
+             (t
+              "unknownuser")))
           (if (consp mode) mode (list mode))))
     (if (consp mode) result (car result))))