* nnimap.el (nnimap-credentials): Add IMAP-specific user and password prompt.
* 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
(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)))