Fix auth-info-password

* lisp/auth-source.el (auth-info-password): :secret can be a
cascaded function.
This commit is contained in:
Michael Albinus 2024-06-12 10:24:34 +02:00
parent 778f8c793d
commit 59261e6f4f

View file

@ -874,9 +874,9 @@ while \(:host t) would find all host entries."
(defun auth-info-password (auth-info) (defun auth-info-password (auth-info)
"Return the :secret password from the AUTH-INFO." "Return the :secret password from the AUTH-INFO."
(let ((secret (plist-get auth-info :secret))) (let ((secret (plist-get auth-info :secret)))
(if (functionp secret) (while (functionp secret)
(funcall secret) (setq secret (funcall secret)))
secret))) secret))
(defun auth-source-pick-first-password (&rest spec) (defun auth-source-pick-first-password (&rest spec)
"Pick the first secret found by applying `auth-source-search' to SPEC." "Pick the first secret found by applying `auth-source-search' to SPEC."