Skip to content

Commit

Permalink
tentative synchronous export for batch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
minyez committed Jul 23, 2024
1 parent 34e6ea9 commit c539038
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions ox-pandoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -1885,13 +1885,16 @@ If 0, target is file and converted file will automatically be opend."
(org-pandoc-put-options `((epub-metadata ,meta-temp-file)))
(with-temp-file meta-temp-file
(insert org-pandoc-epub-meta))))
(let ((process
(org-pandoc-run input-file output-file format
'org-pandoc-sentinel org-pandoc-option-table)))
(process-put process 'files (list input-file meta-temp-file css-temp-file))
(process-put process 'output-file output-file)
(process-put process 'local-hook-symbol local-hook-symbol)
(process-put process 'buffer-or-open buffer-or-open))))
(if noninteractive
(org-pandoc-run input-file output-file format
'org-pandoc-sentinel org-pandoc-option-table)
(let ((process
(org-pandoc-run input-file output-file format
'org-pandoc-sentinel org-pandoc-option-table)))
(process-put process 'files (list input-file meta-temp-file css-temp-file))
(process-put process 'output-file output-file)
(process-put process 'local-hook-symbol local-hook-symbol)
(process-put process 'buffer-or-open buffer-or-open)))))

(defun org-pandoc-sentinel (process message)
"PROCESS sentinel with MESSAGE.
Expand Down Expand Up @@ -1953,12 +1956,14 @@ when the process completes."
(ht-keys options))
,(expand-file-name input-file))))
(message "Running pandoc with args: %s" args)
(let ((process
(apply 'start-process
`("pandoc" ,(generate-new-buffer "*Pandoc*")
,org-pandoc-command ,@args))))
(set-process-sentinel process sentinel)
process)))
(if noninteractive
(apply 'call-process `(,org-pandoc-command nil nil nil ,@args))
(let ((process
(apply 'start-process
`("pandoc" ,(generate-new-buffer "*Pandoc*")
,org-pandoc-command ,@args))))
(set-process-sentinel process sentinel)
process))))

(defun org-pandoc-startup-check ()
"Check the current pandoc version."
Expand Down

0 comments on commit c539038

Please sign in to comment.