Org-mode export backends are defined as instances of the cl structure org-export-backend
:
(cl-defstruct (org-export-backend (:constructor org-export-create-backend)
(:copier nil))
name parent transcoders options filters blocks menu)
The documentation string of cl-defstruct
says:
This macro defines a new data type called NAME that stores data in SLOTs. It defines a
make-NAME
constructor, acopy-NAME
copier, aNAME-p
predicate, and slot accessors namedNAME-SLOT
. You can use the accessors to set the corresponding slots, viasetf
.…
Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS…), where SDEFAULT is the default value of that slot and SOPTIONS are keyword-value pairs for that slot. Currently, only one keyword is supported,
:read-only
. If this has a non-nil value, that slot cannot be set viasetf
.
The options
slot of org-export-backend
is not marked with the keyword :read-only
.
Therefore setting backend options with cl-pushnew
should work as in the next example Elisp snippet:
(require 'cl-lib)
(with-eval-after-load 'ox-ascii
(cl-pushnew
'(:ascii-upcase-title nil "ascii-upcase-title" 'org+-ascii-upcase-title)
(org-export-backend-options (org-export-get-backend 'ascii))))
But this does not work reliable. I had to remove it from an answer to a question about the ox-ascii export plugin.
If one calls M-x load-library
RET ox-ascii
RET after this setting, one gets the error
let*: Symbol’s function definition is void: \(setf\ org-export-backend-options\)
This error presents itself with the following message if one tries to export with org-export-dispatch
:
Problems while trying to load export back-end ‘ascii’
What does cause this error? How can I prevent it?