]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus/mail-source.el (mail-source-set-1): Fix indent and simplify
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 15:51:46 +0000 (11:51 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 15:51:46 +0000 (11:51 -0400)
lisp/gnus/mail-source.el

index 5d0c0e2654b5d75e3ea8672b15dab8cedaecbcae..04de70bf0f19e2ad502b78384a7c1ac8accc28b3 100644 (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 ()