(let* ((type (pop source))
(defaults (cdr (assq type mail-source-keyword-map)))
(search '(:max 1))
- found default value keyword user-auth pass-auth) ;; auth-info
+ found default keyword user-auth pass-auth) ;; auth-info
;; append to the search the useful info from the source and the defaults:
;; user, host, and port
;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL
;; using `mail-source-value' to evaluate the plist value
(set (mail-source-strip-keyword (setq keyword (car default)))
- ;; note the following reasons for this structure:
+ ;; Note the following reasons for this structure:
;; 1) the auth-sources user and password override everything
;; 2) it avoids macros, so it's cleaner
;; 3) it falls through to the mail-sources and then default values
(cond
((and
- (eq keyword :user)
- (setq user-auth
- (plist-get
- ;; cache the search result in `found'
- (or found
- (setq found (nth 0 (apply #'auth-source-search
- search))))
- :user)))
+ (eq keyword :user)
+ (setq user-auth
+ (plist-get
+ ;; cache the search result in `found'
+ (or found
+ (setq found (nth 0 (apply #'auth-source-search
+ search))))
+ :user)))
user-auth)
- ((and ; cf. 'auth-source-pick-first-password'
+ ((and ; cf. 'auth-source-pick-first-password'
(eq keyword :password)
(setq pass-auth
(plist-get
(if (functionp pass-auth)
(setq pass-auth (funcall pass-auth))
pass-auth))
- (t (if (setq value (plist-get source keyword))
- (mail-source-value value)
- (mail-source-value (cadr default)))))))))
+ (t (mail-source-value (or (plist-get source keyword)
+ (cadr default)))))))))
(eval-and-compile
(defun mail-source-bind-common-1 ()