Is there a way to use a variable to hold the set of let bindings for passing to a later call?
(setq a '((org-export-with-toc nil)
;; Perform the export here)
This is for the goal of allowing outorg-export to add an
options alist specifying how to export the indicated element.
Editing to provide clarity (
@sds's answer of using
cl-progv is what I needed):
I want to be able to pass a variable/alist of values as part of an 'export definition' to the org-export engine.
If NIL, nothing will be exported. Otherwise it must be a list of entries for sections to be exported and exporter to use. Each entry is a list like this: (headline &optional exporter file level options) headline Outshine commented headline to export from. If t, defaults to entire file. exporter Org exporter format to use when exporting. If not specified (blank, t or nil), defaults to an Org file. This is a symbol for the exporter to use. If exporting to PDF, specify `PDF' rather than `LATEX' otherwise it will be exported as a `.tex' file. file If set, specifies the export file name. If `T', defaults to the name of the exported buffer. If `NIL', defaults to the name of the headline being exported if specified, or buffer file name if entire buffer is exported. level By default `SECTION' will search for top level headlines `* '. Level allows for exporting specific sublevels instead. This integer indicates how many stars to match. options List of export variables to be set prior to export. These values are provided as a let binding around the export process.
An example command would be
("Documentation" ascii t 1 ((org-export-with-toc nil)))
In the export command itself each value is let bound to the appropriate field, and then in the end
org-ascii-export-to-ascii performs the export (replace ascii as specified). I'd tried using
:EXPORT_OPTIONS: properties but they were not being recognized when converting to outorg and exporting, and
#+OPTIONS: were not either. Instead (also allowing different options based on export format, or even multiple exports to the same format with different options) I want to use the
options value as a set of let-bindings around the export process to allow it to be modified.