diff options
| author | Michael Albinus <michael.albinus@gmx.de> | 2026-05-20 10:10:30 +0200 |
|---|---|---|
| committer | Michael Albinus <michael.albinus@gmx.de> | 2026-05-20 10:10:30 +0200 |
| commit | 1754015c6034d65b047d0ada23a406f114d7850d (patch) | |
| tree | 02d23f447251adda335f4732bd43bfffe1036c90 | |
| parent | 8f31ccbf823bffa9ac46514e3c0ab1e464979c92 (diff) | |
Improve auth-source-backend-parse
* lisp/auth-source.el (auth-source-backend-parse): Use `run-hook-wrapped'.
Suggested by Augusto Stoffel <arstoffel@gmail.com>.
Transform a warning into a debug message.
| -rw-r--r-- | lisp/auth-source.el | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index f541dd3d141..ec48ab31580 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -361,23 +361,18 @@ soon as a function returns non-nil.") (defun auth-source-backend-parse (entry) "Create an `auth-source-backend' from an ENTRY in `auth-sources'." - (let* ((auth-source-backend-parser-functions - ;; The functions shall drop backends of type `ignore', in - ;; order to let the hook continue. - (mapcar - (lambda (fun) - `(lambda (entry) - (and-let* ((result (funcall ',fun entry)) - ((not (eq (slot-value result 'type) 'ignore))) - result)))) - auth-source-backend-parser-functions)) - (backend - (run-hook-with-args-until-success - 'auth-source-backend-parser-functions entry))) + (let* ((backend + (run-hook-wrapped + 'auth-source-backend-parser-functions + (lambda (fun entry) + (when-let* ((result (funcall fun entry)) + (_ (not (eq (slot-value result 'type) 'ignore)))) + result)) + entry))) (unless backend ;; none of the parsers worked - (auth-source-do-warn + (auth-source-do-debug "auth-source-backend-parse: invalid backend spec: %S" entry) (setq backend (make-instance 'auth-source-backend :source "" |
