aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2022-03-18 11:51:46 -0400
committerStefan Monnier2022-03-18 11:51:46 -0400
commitf51e12feceae18f0b6715142a4e61d6522f79389 (patch)
tree7fb46a33eaa5552ce62e6d0b76759ea4adf51468
parent4d61badad15e8213c84798b85f10868fc48b94ee (diff)
downloademacs-f51e12feceae18f0b6715142a4e61d6522f79389.tar.gz
emacs-f51e12feceae18f0b6715142a4e61d6522f79389.zip
* lisp/gnus/mail-source.el (mail-source-set-1): Fix indent and simplify
-rw-r--r--lisp/gnus/mail-source.el27
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index 5d0c0e2654b..04de70bf0f1 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -413,7 +413,7 @@ the `mail-source-keyword-map' variable."
413 (let* ((type (pop source)) 413 (let* ((type (pop source))
414 (defaults (cdr (assq type mail-source-keyword-map))) 414 (defaults (cdr (assq type mail-source-keyword-map)))
415 (search '(:max 1)) 415 (search '(:max 1))
416 found default value keyword user-auth pass-auth) ;; auth-info 416 found default keyword user-auth pass-auth) ;; auth-info
417 417
418 ;; append to the search the useful info from the source and the defaults: 418 ;; append to the search the useful info from the source and the defaults:
419 ;; user, host, and port 419 ;; user, host, and port
@@ -440,22 +440,22 @@ the `mail-source-keyword-map' variable."
440 ;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL 440 ;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL
441 ;; using `mail-source-value' to evaluate the plist value 441 ;; using `mail-source-value' to evaluate the plist value
442 (set (mail-source-strip-keyword (setq keyword (car default))) 442 (set (mail-source-strip-keyword (setq keyword (car default)))
443 ;; note the following reasons for this structure: 443 ;; Note the following reasons for this structure:
444 ;; 1) the auth-sources user and password override everything 444 ;; 1) the auth-sources user and password override everything
445 ;; 2) it avoids macros, so it's cleaner 445 ;; 2) it avoids macros, so it's cleaner
446 ;; 3) it falls through to the mail-sources and then default values 446 ;; 3) it falls through to the mail-sources and then default values
447 (cond 447 (cond
448 ((and 448 ((and
449 (eq keyword :user) 449 (eq keyword :user)
450 (setq user-auth 450 (setq user-auth
451 (plist-get 451 (plist-get
452 ;; cache the search result in `found' 452 ;; cache the search result in `found'
453 (or found 453 (or found
454 (setq found (nth 0 (apply #'auth-source-search 454 (setq found (nth 0 (apply #'auth-source-search
455 search)))) 455 search))))
456 :user))) 456 :user)))
457 user-auth) 457 user-auth)
458 ((and ; cf. 'auth-source-pick-first-password' 458 ((and ; cf. 'auth-source-pick-first-password'
459 (eq keyword :password) 459 (eq keyword :password)
460 (setq pass-auth 460 (setq pass-auth
461 (plist-get 461 (plist-get
@@ -468,9 +468,8 @@ the `mail-source-keyword-map' variable."
468 (if (functionp pass-auth) 468 (if (functionp pass-auth)
469 (setq pass-auth (funcall pass-auth)) 469 (setq pass-auth (funcall pass-auth))
470 pass-auth)) 470 pass-auth))
471 (t (if (setq value (plist-get source keyword)) 471 (t (mail-source-value (or (plist-get source keyword)
472 (mail-source-value value) 472 (cadr default)))))))))
473 (mail-source-value (cadr default)))))))))
474 473
475(eval-and-compile 474(eval-and-compile
476 (defun mail-source-bind-common-1 () 475 (defun mail-source-bind-common-1 ()