The attached patch adds a new functions org-export-as-string. ,---- | org-export-string is a Lisp function in `org-exp.el'. | | (org-export-string STRING FMT &optional DIR) | | Export STRING to FMT using existing export facilities. | During export STRING is saved to a temporary file whose location | could vary. Optional argument DIR can be used to force the | directory in which the temporary file is created during export | which can be useful for resolving relative paths. Dir defaults | to the value of `temporary-file-directory'. `---- This function should be useful in user code, and can already reduce the amount of code in ob-org.el and org-mime.el.