Function: mail-source-bind
mail-source-bind is a macro defined in mail-source.el.gz.
Signature
(mail-source-bind TYPE-SOURCE &rest BODY)
Documentation
Return a let form that binds all variables in source TYPE.
TYPE-SOURCE is a list where the first element is the TYPE, and the second variable is the SOURCE. At run time, the mail source specifier SOURCE will be inspected, and the variables will be set according to it. Variables not specified will be given default values.
The user and password will be loaded from the auth-source values
if those are available. They override the original user and
password in a second let form.
After this is done, BODY will be executed in the scope
of the second let form.
The variables bound and their default values are described by
the mail-source-keyword-map variable.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mail-source.el.gz
(defmacro mail-source-bind (type-source &rest body)
"Return a `let' form that binds all variables in source TYPE.
TYPE-SOURCE is a list where the first element is the TYPE, and
the second variable is the SOURCE.
At run time, the mail source specifier SOURCE will be inspected,
and the variables will be set according to it. Variables not
specified will be given default values.
The user and password will be loaded from the auth-source values
if those are available. They override the original user and
password in a second `let' form.
After this is done, BODY will be executed in the scope
of the second `let' form.
The variables bound and their default values are described by
the `mail-source-keyword-map' variable."
(declare (indent 1) (debug (sexp body)))
;; FIXME: Use lexical vars, i.e. don't initialize the vars inside
;; `mail-source-set-1' via `set'.
(let ((bindings (mail-source-bind-1 (car type-source))))
`(with-suppressed-warnings ((lexical ,@(mapcar #'car bindings)))
(dlet ,bindings
(mail-source-set-1 ,(cadr type-source))
,@body))))