* lisp/gnus/mail-source.el (mail-source-set-1): Fix indent and simplify

This commit is contained in:
Stefan Monnier
2022-03-18 11:51:46 -04:00
parent 4d61badad1
commit f51e12fece

View File

@@ -413,7 +413,7 @@ the `mail-source-keyword-map' variable."
(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
@@ -440,22 +440,22 @@ the `mail-source-keyword-map' variable."
;; 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
@@ -468,9 +468,8 @@ the `mail-source-keyword-map' variable."
(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 ()