By default, functions defined in a separate-namespace VLX are not exposed to the document namespace from which the VLX is loaded. You must use the vl-doc-export function to expose functions to document namespaces. When issued from a VLX that runs in its own namespace, vl-doc-export exposes the specified function to any document namespace that loads the VLX. The vl-doc-export function accepts a single argument, a symbol identifying the function name. For example, look at the following code:
(vl-doc-export 'kertrats)
(defun kertrats ()
(princ "This function goes nowhere")
)
This example defines the kertrats function, which simply prints a message. The defun for the function is preceded by a vl-doc-export call that causes the function to be exported to the document namespace.
To see how vl-doc-export works in a separate-namespace VLX
(defun kertrats ()
(princ "This function goes nowhere")
)
Note that this code does not contain a call to vl-doc-export.
You should receive an error message indicating the function is not defined.
(vl-doc-export 'kertrats)
You can issue a vl-doc-export call outside the context of a separate-namespace VLX application, but it has no effect.
The vl-list-loaded-vlx function returns a list of all separate-namespace applications associated with the current document. For example:
_$ (vl-list-loaded-vlx)
(DOCTEST)
To determine what functions have been exported from a separate-namespace application into the current document, use vl-list-exported-functions. When calling this function, you must pass it a string naming the application you are checking. For example, the following command returns a list of the functions exported by the doctest application:
_$ (vl-list-exported-functions "doctest")
("KERTRATS")
The results show that a single function, kertrats, was exported from doctest to the current document's namespace.