emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [Exporter] How to save 'info' plist for later use?
Date: Wed, 10 Jul 2013 12:56:43 +0200	[thread overview]
Message-ID: <87a9lur8d0.fsf@gmail.com> (raw)


Hi List, 

how do I get my hands on the 'info' plist (i.e. the communication-channel)
when I try to export data that is (only an isolated) part of a parse-tree? 

Say that originally a whole buffer was parsed, thus the full tree and
options info was available at that point. But then parts of the
resulting parse-tree are extracted with org-element-map and are exported
separately as data later on.

In that case, I don't know how to pass the original 'info' plist to the
export function, so export results are not complete due to the missing
context information.

Here is a minimal example:

With file minimal.org

#+begin_src org
* A
B
#+end_src

I call

#+begin_src emacs-lisp
(setq parse-tree
        (with-current-buffer
            (find-file-noselect
             "/path/to/minimal.org")
          (org-element-parse-buffer)))

(let ((elem (org-element-map parse-tree 'headline 'identity nil t)))
  (insert (format "\n\n%s\n\n" elem))
  ;; nil instead of info as 3rd parameter
  (insert (org-export-data-with-backend  elem 'html nil))) 
#+end_src

and get (note the incomplete IDs in the html)

#+begin_quote
(headline (:raw-value A :begin 1 :end 7 :pre-blank 0 :hiddenp
nil :contents-begin 5 :contents-end 7 :level 1 :priority
nil :tags nil :todo-keyword nil :todo-type nil :post-blank
0 :footnote-section-p nil :archivedp nil :commentedp nil :quotedp
nil :CATEGORY nil :title (A) :parent (org-data nil
#0)) (section (:begin 5 :end 7 :contents-begin 5 :contents-end
7 :post-blank 0 :parent #0) (paragraph (:begin 5 :end
7 :contents-begin 5 :contents-end 7 :post-blank
0 :post-affiliated 5 :parent #1) B )))

<nil id="outline-container-sec-" class="outline-2">
<h2 id="sec-">A</h2>
<div class="outline-text-2" id="text-">
<p>
B
</p>
</div>
</nil>
#+end_quote

How could I get my hands on the 'info' plist during the buffer parsing
and save it for later use in calls like

#+begin_src emacs-lisp
(org-export-data-with-backend  elem 'html info)
#+end_src

?

-- 
cheers,
Thorsten

             reply	other threads:[~2013-07-10 10:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 10:56 Thorsten Jolitz [this message]
2013-07-10 11:34 ` [Exporter] How to save 'info' plist for later use? Robert Klein
2013-07-10 12:21   ` Thorsten Jolitz
2013-07-10 15:41     ` Eric Abrahamsen
2013-07-10 11:46 ` Thorsten Jolitz
2013-07-10 12:17   ` Nick Dokos
2013-07-10 12:30     ` Thorsten Jolitz
2013-07-10 13:59       ` Jambunathan K
2013-07-10 15:33         ` Thorsten Jolitz
2013-07-10 15:40       ` Eric Abrahamsen
2013-07-10 16:57         ` Thorsten Jolitz
2013-07-10 17:16           ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9lur8d0.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).