With-cbd
To set the connected book directory
With-cbd provides a way to set the connected book directory
(see cbd) within a given scope. For example, evaluation of the
following form is equivalent to evaluation of the form, (include-book
"arithmetic/top" :dir :system).
(with-cbd (cdr (assoc-eq :system (project-dir-alist (w state))))
(include-book "arithmetic/top"))
See cbd for a description of the connected book directory.
General Form:
(with-cbd str form)
where str evaluates to a nonempty string that represents the desired
directory (see pathname) and form evaluates to an error-triple. Thus, the effect of (with-cbd str form) is to evaluate
first (set-cbd str) and then to evaluate form, after which the
connected book directory is restored to the value it had before that
evaluation of set-cbd. However, the implementation is designed so that
the connected book directory is restored even when the evaluation of form
causes an error.
The form (with-cbd str ev) is an event form if ev is an
event form; thus, it may occur in books as well as encapsulate
and progn events. See embedded-event-form.