When exporting asynchronously with an essentially empty org-export-async-init-file, the process fails with this backtrace:
Debugger entered--Lisp error: (invalid-read-syntax "#" 1 0) read(#<buffer *load*>) load-with-code-conversion("/var/folders/1q/6syg63894h5bqlwp2jdh8r440000gn/T/o..." "/var/folders/1q/6syg63894h5bqlwp2jdh8r440000gn/T/o..." nil t) command-line-1(("-l" "/Users/iostapyshyn/.emacs.d/org-export.el" "-l" "/var/folders/1q/6syg63894h5bqlwp2jdh8r440000gn/T/o...")) command-line() normal-top-level() I have tracked the issue down to this bit in org-export-process tmpfile: (or (ignore-errors (funcall '#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_77> "paper.tex")) ... Read doesn't like the '# syntax, seems like it should have been #' instead. I have quoted the post-process lambda in org-latex-export-to-pdf (see attached diff) and it seems to have fixed the issue for me. However it doesn't seem like a proper solution. Emacs : GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71)) of 2021-06-20 Package: Org mode version 9.4.4 (release_9.4.4 @ /Users/iostapyshyn/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)
diff -u --label /Users/iostapyshyn/emacs/lisp/org/ox-latex.el --label /Users/iostapyshyn/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/ox-latex.el.gz /Users/iostapyshyn/emacs/lisp/org/ox-latex.el /var/folders/1q/6syg63894h5bqlwp2jdh8r440000gn/T/jka-comShObnq --- /Users/iostapyshyn/emacs/lisp/org/ox-latex.el +++ /Users/iostapyshyn/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/ox-latex.el.gz @@ -3633,7 +3633,7 @@ (let ((outfile (org-export-output-file-name ".tex" subtreep))) (org-export-to-file 'latex outfile async subtreep visible-only body-only ext-plist - (lambda (file) (org-latex-compile file))))) + '(lambda (file) (org-latex-compile file))))) (defun org-latex-compile (texfile &optional snippet) "Compile a TeX file. Diff finished. Sun Jun 20 12:22:50 2021