Nicolas Goaziou writes: > mohsin kaleem writes: > >> I've been trying to get async-export setup for the past day and I've >> found it keeps failing due to an unexpected # in the compilation script >> generated by org-export. >> >> After doing a little debugging I found the script contained >> ~(funcall '# "foo.tex")~ >> so at some point in the export org-mode is including an evaluated lambda >> when a quoted one is required. > > Your bug sounds plausible, but I cannot reproduce it. Hmmm... that's strange. Running: 1. `emacs -nw` 2. `C-x C-f ~/foo.org` 3. Insert some text 4. `M-: (setq org-export-in-background t)` 5. `M-: (setq org-export-async-init-file "/path/to/some/file.el")` For some reason async export fails when this is nil. 6. `M-x org-export-dispatch lp` Ends with the export process failing and the `*Org Export Process*` buffer containing: ``` Loading /home/mohkale/.config/emacs/early-init.el (source)... Debugger entered--Lisp error: (invalid-read-syntax "#" 1 0) read(#) eval-buffer(# nil "/tmp/org-export-processv2hIqF" nil t) ; Reading at buffer position 3743 load-with-code-conversion("/tmp/org-export-processv2hIqF" "/tmp/org-export-processv2hIqF" nil t) load("/tmp/org-export-processv2hIqF" nil t) command-line-1(("-l" "/home/mohkale/.config/emacs/lisp/+org-async-init.e..." "-l" "/tmp/org-export-processv2hIqF")) command-line() normal-top-level() ``` This might be related to newer versions of emacs and how they treat lambdas internally, could you retry with emacs 28.0.5 if you still can't reproduce it. >> - (lambda (file) (org-latex-compile file))))) >> + `(lambda (file) (org-latex-compile file))))) > > Anyhow, would #'org-latex-compile fix the issue, too? Apologies if my explanation wasn't sufficient, I've attached a copy of the build script that org-export generates to this email.