I am unable to asynchronously export certain org buffers ("Process
‘org-export-process’ exited abnormally"). Specifically, when I have
poly-org mode enabled on a buffer. It is a similar issue to this one:
https://list.orgmode.org/aw_wwlJcCuUcOWTA5vHxOQaat4W5s33Auov2jBSfrpkgCoM2JuGIUN6WNDQMfBYQL2NQog7cewykBnCPQa2ZuRr0Nc0mwyf4A_yEyYvxxZM=@protonmail.com/
I find poly-org mode very useful, and I use org export all day long, so I
would like to reconcile the two if possible.

The org export backend is complicated compared to my debugging skills, but
I have been able to determin the following.
1) The issue happens because of poly-org.
2) It happens with -q and a minimal configuration (org + poly-org in init).
3) It happens even exporting a minimal org file, like a heading "test" and
the text "a"
4) It only happens with org-export-in-background t
5) With org-export-async-debug t the error given in *Org Export Process* is
like:
   Invalid read syntax: "#<", 6, 407

   Error: invalid-read-syntax ("#<" 6 407)
   read(#<buffer  *load*>)
   eval-buffer(#<buffer  *load*> nil
"/private/var/.../org-export-processmiGz9w" nil t)
   load-with-code-conversion("/private/var/.../org-export-processmiGz9w"
"/private/var/.../org-export-processmiGz9w" nil t)
   command-line-1(("-l" "/Users/.../minimal-emacs/init.el" "-l"
"/var/.../org-export-processmiGz9w"))
   command-line()
   normal-top-level()

6) The file that is being eval'ed there has content:
   ;; -*- coding: utf-8-emacs-unix; lexical-binding:t -*-
   (with-temp-buffer (setq debug-on-error t) (setq kill-emacs-hook nil
org-babel-confirm-evaluate-answer-no t) (require 'ox) (funcall '#[0 "\306
\307=\204 �\310\311!\210\306\211 \307 *\210\301\211\203.�\211@\211\242
\243\310 ! L\266 A\202 �\210\304\203=�\306 \312
\210\304c)\210\313\314\315\"\210\303\203K�\316\317\303\"\210\302b\210\300\211\203\205�\211@\211\242
\243\211\242 \243\211\242 \243 \320 \" \203 �\321 \211A\262 \242 \211A\262
\242#\210\202h�\266 A\202O�\210\305\204\215�\322 \210\323C\211 )\207" [nil
((org-fold-core--last-buffer-chars-modified-tick . 86)
(org-src-fontify-natively . t) (char-property-alias-alist (face
font-lock-face)) (org-target-link-regexps) (org-target-link-regexp)
(org-macro-templates ("date" . "") ("title" . "") ("email" . "") ("author"
. "") ("input-file" . "test.org") ("modification-time" . #[641 "\302 \303
!\203 �\304\301!\206 �\300\"\207" [(26544 34238 763774 635000)
"/Users/ben/Desktop/test.org" format-time-string org-string-nw-p
org-macro--vc-modified-time] 7 "

   (fn ARG1 &optional ARG2 &rest _)"]) ("keyword" lambda (arg1 &rest _)
(org-macro--find-keyword-value arg1 t)) ("n" lambda (&optional arg1 arg2
&rest _) (org-macro--counter-increment arg1 arg2)) ("property" lambda (arg1
&optional arg2 &rest _) (org-macro--get-property arg1 arg2)) ("time" lambda
(arg1 &rest _) (format-time-string arg1))) (org-table-may-need-update . t)
(org-link-descriptive . t) (org-fold-core--spec-symbols (property-drawer .
org-hide-drawer) (drawer . org-hide-drawer) (org-hide-drawer .
org-hide-drawer) (verse-block . org-hide-block) (src-block .
org-hide-block) (special-block . org-hide-block) (quote-block .
org-hide-block) (export-block . org-hide-block) (example-block .
org-hide-block) (dynamic-block . org-hide-block) (comment-block .
org-hide-block) (center-block . org-hide-block) (block . org-hide-block)
(org-hide-block . org-hide-block) (plain-list . outline) (inlinetask .
outline) (outline . outline) (heading . outline) (headline . outline)
(outline . outline)) (org-fold-core--spec-list outline org-hide-block
org-hide-drawer) (org-fold-core--specs (outline (:visible) (:ellipsis .
"...") (:isearch-ignore) (:global) (:isearch-open . t) (:front-sticky . t)
(:rear-sticky) (:fragile . org-fold--reveal-outline-maybe) (:alias headline
heading outline inlinetask plain-list) (:font-lock . t)) (org-hide-block
(:visible) (:ellipsis . "...") (:isearch-ignore) (:global) (:isearch-open .
t) (:front-sticky . t) (:rear-sticky) (:fragile .
org-fold--reveal-drawer-or-block-maybe) (:alias block center-block
comment-block dynamic-block example-block export-block quote-block
special-block src-block verse-block) (:font-lock . t)) (org-hide-drawer
(:visible) (:ellipsis . "...") (:isearch-ignore) (:global) (:isearch-open .
t) (:front-sticky . t) (:rear-sticky) (:fragile .
org-fold--reveal-drawer-or-block-maybe) (:alias drawer property-drawer)
(:font-lock . t))) (org-fold-core--isearch-special-specs org-link)
(org-fold-core-extend-changed-region-functions
org-fold--extend-changed-region) (org-fold-core-isearch-open-function .
org-fold--isearch-reveal) (org-latex-and-related-regexp . "")
(org-todo-line-tags-regexp . "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?:
+\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]:_@#%]+:\\)\\)?[ ]*$")
(org-complex-heading-regexp-format . "^\\(\\*+\\)\\(?:
+\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:COMMENT
+\\)?\\(?:\\[[0-9%%/]+\\] *\\)*\\(%s\\)\\(?: *\\[[0-9%%/]+\\]\\)*\\)\\(?:[
]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?[ ]*$") (org-complex-heading-regexp .
"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?:
+\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$")
(org-todo-line-regexp . "^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?:
+\\(.*?\\)\\)?[ ]*$") (org-not-done-heading-regexp . "^\\(\\*+\\)\\(?:
+\\(TODO\\)\\)\\(?: +\\(.*?\\)\\)?[ ]*$") (org-not-done-regexp .
"\\(TODO\\)") (org-todo-regexp . "\\(DONE\\|TODO\\)")
(org-not-done-keywords "TODO") (org-todo-log-states) (org-todo-sets ("TODO"
"DONE")) (org-todo-heads "TODO") (org-done-keywords "DONE")
(org-todo-keywords-1 "TODO" "DONE") (org-todo-key-trigger)
(org-todo-key-alist (:startgroup) ("TODO" . 116) ("DONE" . 100)
(:endgroup)) (org-todo-kwd-alist ("TODO" sequence "TODO" "DONE" "DONE")
("DONE" sequence "TODO" "DONE" "DONE")) (org-table-formula-constants-local)
(org-keyword-properties) (org-tag-groups-alist) (org-current-tag-alist)
(org-file-tags) (org-mode-loading) (buffer-file-name . "/Users/ben/Desktop/
test.org") (default-directory . "/Users/ben/Desktop/")
(buffer-file-coding-system . undecided-unix)) 9 (1 10) #("* test
   a
   " 0 2 (face org-level-1 :pm-span-old (nil 1 11 #s(pm-host-chunkmode
#s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode
always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound #<buffer test.org>)) :pm-mode
org-mode :pm-span (nil 1 10 #s(pm-host-chunkmode #s(pm-host-chunkmode
eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil
nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound #<buffer test.org>)) fontified t) 2 6 (face
org-level-1 :pm-span-old (nil 1 11 #s(pm-host-chunkmode
#s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode
always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound #<buffer test.org>)) :pm-mode
org-mode :pm-span (nil 1 10 #s(pm-host-chunkmode #s(pm-host-chunkmode
eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil
nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound #<buffer test.org>)) fontified t) 6 7
(:pm-span-old (nil 1 11 #s(pm-host-chunkmode #s(pm-host-chunkmode
eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil
nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound #<buffer test.org>)) :pm-mode org-mode
:pm-span (nil 1 10 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound
"org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil
nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
#<buffer test.org>)) fontified t) 7 8 (:pm-span-old (nil 1 11
#s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode
poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:"
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer
test.org>)) :pm-mode org-mode :pm-span (nil 1 10 #s(pm-host-chunkmode
#s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode
always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound #<buffer test.org>)) src-block
t font-lock-fontified t fontified t) 8 9 (:pm-span-old (nil 1 11
#s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode
poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:"
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer
test.org>)) :pm-mode org-mode :pm-span (nil 1 10 #s(pm-host-chunkmode
#s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode
always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound #<buffer test.org>)) fontified
t)) nil t org-mode make-local-variable delay-mode-hooks erase-buffer
org-element-cache-reset nil no-persistence apply narrow-to-region
make-overlay overlay-put org-fold-core--update-buffer-folds #[128
"\300\207" [t] 2 "

   (fn &rest _)"] inhibit-modification-hooks major-mode org-inhibit-startup
inhibit-read-only write-contents-functions] 16]) (restore-buffer-modified-p
nil) (print (org-export-as 'html nil nil nil 'nil)))

7) It seems that poly-org caches a lot of data as text properties (?),
which gets loaded into the temp file passed to async export, and this is
not being parsed correctly.
8) Indeed, in the test.org file, describe-text-properties returns things
like
   Text content at position 1:


   There is an overlay here:
   From 1 to 1
   face                 highlight


   There's are text properties here:
   :pm-mode             org-mode
   :pm-span             [Show]
   :pm-span-old         [Show]
   face                 org-level-1
   fontified            t

   And then [Show]:

   (nil 1 10
   #s(pm-host-chunkmode
   #s(pm-host-chunkmode eieio--unbound "org" nil org-mode
    poly-fallback-mode always 2 0 0 nil nil
    nil nil nil nil nil nil)
"org:" eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound eieio--unbound
eieio--unbound eieio--unbound eieio--unbound #<buffer
test.org>))

9) My first question is if this is easily fixable. For example, maybe the
export process shouldn't care about text properties, and it is as simple as
stripping them out at the start?
10) On the other hand, if exports should care about text properties, I am
not even sure how one might fix this.

I'm hoping that some expert on the export backend can help here.

Reply via email to