* [kisara.moe] Bug: async latex export fails due to post-process lambda [9.4.4 (release_9.4.4-188-ga8df76 @ /home/mohkale/.config/emacs/lisp/straight/build/org/)] @ 2021-05-26 1:44 mohsin kaleem 2021-05-29 20:41 ` Nicolas Goaziou 0 siblings, 1 reply; 15+ messages in thread From: mohsin kaleem @ 2021-05-26 1:44 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 529 bytes --] 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 '#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_77> "foo.tex")~ so at some point in the export org-mode is including an evaluated lambda when a quoted one is required. I tracked down the bug to the ~org-latex-export-to-pdf~ function and fixed it by quoting the unquoted lambda. [-- Attachment #2: fix --] [-- Type: #("text/x-patch" 0 1 (face completions-first-difference completion-score 0.0)), Size: 520 bytes --] diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index fb9fc3cd6..d3220d2bb 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3639,7 +3639,7 @@ Return PDF file's name." (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. [-- Attachment #3: Type: text/plain, Size: 1813075 bytes --] I haven't had a chance to check any of the other exporters although this may be an issue for them as well. Emacs : GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-05-24 Package: Org mode version 9.4.4 (release_9.4.4-188-ga8df76 @ /home/mohkale/.config/emacs/lisp/straight/build/org/) current state: ============== (setq org-archive-location "/home/mohkale/.config/emacs/org/archive.org::* %s" org-link-elisp-confirm-function 'yes-or-no-p org-directory "/home/mohkale/.config/emacs/org" org-ditaa-jar-path "/home/mohkale/.config/emacs/var/org/bin/ditaa.jar" org-ref-cite-onclick-function '(closure (t) (_) (org-ref-cite-hydra/body)) org-ref-create-notes-hook '((lambda nil (org-narrow-to-subtree) (insert (format "cite:%s\n" (org-entry-get (point) "CUSTOM_ID")))) ) org-hide-emphasis-markers t org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-ref-insert-cite-function 'org-ref-consult-insert-cite-link org-log-done 'time org-fontify-done-headline nil org-ref-open-notes-function '(lambda nil (org-show-entry) (outline-show-branches) (outline-show-children) (org-cycle '(64)) (recenter-top-bottom 0)) org-log-into-drawer "LOGBOOK" org-ref-show-citation-on-enter nil org-agenda-files '("/home/mohkale/.config/emacs/org/notes/index.org" "/home/mohkale/.config/emacs/org/notes/projects/.dotfiles.org" "/home/mohkale/.config/emacs/org/notes/projects/ColorWheel.org" "/home/mohkale/.config/emacs/org/notes/projects/dotty.org" "/home/mohkale/.config/emacs/org/notes/projects/flakes.org" "/home/mohkale/.config/emacs/org/notes/projects/mohkale.io.org" "/home/mohkale/.config/emacs/org/notes/projects/puddle.org" "/home/mohkale/.config/emacs/org/notes/projects/software-hut.org" "/home/mohkale/.config/emacs/org/notes/projects/vimish-fold.org") org-capture-templates '(("t" "Todo" entry (file+function "/home/mohkale/.config/emacs/org/notes/index.org" (closure ((heading-regexp . "\\* TODOs \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* TODOs [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) ) #'doct--fill-template :empty-lines 0 :prepend t :doct (:doct-name "Todo" :keys "t" :before-finalize org-update-parent-todo-statistics :function (closure ((heading-regexp . "\\* TODOs \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* TODOs [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) :todo-state "TODO" :template ("* %{todo-state} %?" " %U") :type entry :hook flyspell-mode :file "/home/mohkale/.config/emacs/org/notes/index.org" :prepend t :empty-lines 0 :doct-custom (:todo-state "TODO")) ) ("T" "Todo with Clipboard" entry (file+function "/home/mohkale/.config/emacs/org/notes/index.org" (closure ((heading-regexp . "\\* TODOs \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* TODOs [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) ) #'doct--fill-template :empty-lines 0 :prepend t :doct (:doct-name "Todo with Clipboard" :keys "T" :template ("* %{todo-state} %?" " %U" " %c") :before-finalize org-update-parent-todo-statistics :function (closure ((heading-regexp . "\\* TODOs \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* TODOs [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) :todo-state "TODO" :type entry :hook flyspell-mode :file "/home/mohkale/.config/emacs/org/notes/index.org" :prepend t :empty-lines 0 :doct-custom (:todo-state "TODO")) ) ("d" "Itinerary" entry (file+function "/home/mohkale/.config/emacs/org/notes/index.org" (closure ((heading-regexp . "\\* Itinerary") (heading . "* Itinerary") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) ) #'doct--fill-template :empty-lines 0 :prepend nil :doct (:doct-name "Itinerary" :keys "d" :prepend nil :function (closure ((heading-regexp . "\\* Itinerary") (heading . "* Itinerary") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) :template ("* %{todo-state} %?") :before-finalize org-update-parent-todo-statistics :todo-state "TODO" :type entry :hook flyspell-mode :file "/home/mohkale/.config/emacs/org/notes/index.org" :empty-lines 0 :doct-custom (:todo-state "TODO")) ) ("j" "Job Application" entry (file+function "/home/mohkale/.config/emacs/org/notes/index.org" (closure ((heading-regexp . "\\* Job Search \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* Job Search [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min)) (search-forward-regexp heading-regexp) (line-beginning-position)) ) (error nil)) ) ) (if heading-point (goto-char heading-point) (goto-char (point-min)) (save-excursion (insert heading "\n"))) ) ) ) "* TODO [#%^{Priority|A|B|C}] %(org-get-link+) - %^{Company}\n DEADLINE: %^{deadline}t\n%^{LOCATION}p%^{DURATION}p\n %?" :empty-lines 0 :prepend t :doct (:doct-name "Job Application" :keys "j" :function (closure ((heading-regexp . "\\* Job Search \\[[[:digit:]]*/[[:digit:]]*\\]") (heading . "* Job Search [/]") t) nil (let ((heading-point (condition-case nil (progn (save-excursion (goto-char (point-min) )