aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2025-10-08 16:09:15 +0200
committerMichael Albinus2025-10-08 16:09:15 +0200
commitebcebaed69cbb2fa0e7206cb3dda910aca452d3b (patch)
treef387a3d1369f9c5f08318475c5587cbd94ab7250
parentfb58ccfdc4ad7c4f0140b0b1a3cf27bcfe387b69 (diff)
downloademacs-ebcebaed69cbb2fa0e7206cb3dda910aca452d3b.tar.gz
emacs-ebcebaed69cbb2fa0e7206cb3dda910aca452d3b.zip
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*'
-rw-r--r--lisp/auth-source.el14
1 files 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.")
376 376
377(defmacro auth-source-backends () 377(defmacro auth-source-backends ()
378 "List of usable backends from `auth-sources'. 378 "List of usable backends from `auth-sources'.
379Filter out backends with type `ignore'.
379A fallback backend is added to ensure, that at least `read-passwd' is called." 380A fallback backend is added to ensure, that at least `read-passwd' is called."
380 `(or (mapcar #'auth-source-backend-parse auth-sources) 381 `(or (seq-keep
382 (lambda (entry)
383 (and-let* ((backend (auth-source-backend-parse entry))
384 ((not (eq (slot-value backend 'type) 'ignore)))
385 backend)))
386 auth-sources)
381 ;; Fallback. 387 ;; Fallback.
382 (list (auth-source-backend 388 (list (auth-source-backend
383 :source "" 389 :source ""
@@ -407,9 +413,9 @@ A fallback backend is added to ensure, that at least `read-passwd' is called."
407If a search key is nil or t (match anything), skip it." 413If a search key is nil or t (match anything), skip it."
408 `(apply #'append (mapcar 414 `(apply #'append (mapcar
409 (lambda (k) 415 (lambda (k)
410 (and-let* ((v (plist-get ,spec k)) 416 (when-let* ((v (plist-get ,spec k))
411 ((not (eq t v))) 417 (_ (not (eq t v))))
412 ((list k (auth-source-ensure-strings v)))))) 418 (list k (auth-source-ensure-strings v))))
413 (auth-source-search-keys ,spec)))) 419 (auth-source-search-keys ,spec))))
414 420
415(defcustom auth-source-ignore-non-existing-file t 421(defcustom auth-source-ignore-non-existing-file t