From ebcebaed69cbb2fa0e7206cb3dda910aca452d3b Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 8 Oct 2025 16:09:15 +0200 Subject: [PATCH] Fix another inconsistency in auth-source.el * lisp/auth-source.el (auth-source-backends): Filter out backends with type `ignore'. (auth-source-search-spec): Use `_' in `and-let*' --- lisp/auth-source.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 402f2617ca8..a06c9820060 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -376,8 +376,14 @@ soon as a function returns non-nil.") (defmacro auth-source-backends () "List of usable backends from `auth-sources'. +Filter out backends with type `ignore'. A fallback backend is added to ensure, that at least `read-passwd' is called." - `(or (mapcar #'auth-source-backend-parse auth-sources) + `(or (seq-keep + (lambda (entry) + (and-let* ((backend (auth-source-backend-parse entry)) + ((not (eq (slot-value backend 'type) 'ignore))) + backend))) + auth-sources) ;; Fallback. (list (auth-source-backend :source "" @@ -407,9 +413,9 @@ A fallback backend is added to ensure, that at least `read-passwd' is called." If a search key is nil or t (match anything), skip it." `(apply #'append (mapcar (lambda (k) - (and-let* ((v (plist-get ,spec k)) - ((not (eq t v))) - ((list k (auth-source-ensure-strings v)))))) + (when-let* ((v (plist-get ,spec k)) + (_ (not (eq t v)))) + (list k (auth-source-ensure-strings v)))) (auth-source-search-keys ,spec)))) (defcustom auth-source-ignore-non-existing-file t