forked from mirrors/org-mode
org-e-confluence: Add asynchronous export support
* contrib/lisp/org-e-confluence.el (org-e-confluence-export-as-confluence): Add asynchronous export support.
This commit is contained in:
parent
fa0e8feea8
commit
457c27d05b
|
@ -140,7 +140,7 @@
|
||||||
|
|
||||||
;; main interactive entrypoint
|
;; main interactive entrypoint
|
||||||
(defun org-e-confluence-export-as-confluence
|
(defun org-e-confluence-export-as-confluence
|
||||||
(&optional subtreep visible-only body-only ext-plist)
|
(&optional async subtreep visible-only body-only ext-plist)
|
||||||
"Export current buffer to a text buffer.
|
"Export current buffer to a text buffer.
|
||||||
|
|
||||||
If narrowing is active in the current buffer, only export its
|
If narrowing is active in the current buffer, only export its
|
||||||
|
@ -148,6 +148,10 @@ narrowed part.
|
||||||
|
|
||||||
If a region is active, export that region.
|
If a region is active, export that region.
|
||||||
|
|
||||||
|
A non-nil optional argument ASYNC means the process should happen
|
||||||
|
asynchronously. The resulting buffer should be accessible
|
||||||
|
through the `org-export-stack' interface.
|
||||||
|
|
||||||
When optional argument SUBTREEP is non-nil, export the sub-tree
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
||||||
at point, extracting information from the headline properties
|
at point, extracting information from the headline properties
|
||||||
first.
|
first.
|
||||||
|
@ -166,11 +170,22 @@ Export is done in a buffer named \"*Org E-Confluence Export*\", which
|
||||||
will be displayed when `org-export-show-temporary-export-buffer'
|
will be displayed when `org-export-show-temporary-export-buffer'
|
||||||
is non-nil."
|
is non-nil."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((outbuf (org-export-to-buffer
|
(if async
|
||||||
'e-confluence "*Org E-Confluence Export*"
|
(org-export-async-start
|
||||||
subtreep visible-only body-only ext-plist)))
|
(lambda (output)
|
||||||
(with-current-buffer outbuf (text-mode))
|
(with-current-buffer (get-buffer-create "*Org E-Confluence Export*")
|
||||||
(when org-export-show-temporary-export-buffer
|
(erase-buffer)
|
||||||
(switch-to-buffer-other-window outbuf))))
|
(insert output)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(text-mode)
|
||||||
|
(org-export-add-to-stack (current-buffer) 'e-confluence)))
|
||||||
|
`(org-export-as 'e-confluence ,subtreep ,visible-only ,body-only
|
||||||
|
',ext-plist))
|
||||||
|
(let ((outbuf (org-export-to-buffer
|
||||||
|
'e-confluence "*Org E-Confluence Export*"
|
||||||
|
subtreep visible-only body-only ext-plist)))
|
||||||
|
(with-current-buffer outbuf (text-mode))
|
||||||
|
(when org-export-show-temporary-export-buffer
|
||||||
|
(switch-to-buffer-other-window outbuf)))))
|
||||||
|
|
||||||
(provide 'org-e-confluence)
|
(provide 'org-e-confluence)
|
||||||
|
|
Loading…
Reference in a new issue