emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Can `org-element-map' act on secondary-strings?
Date: Mon, 08 Jul 2013 18:54:16 +0200	[thread overview]
Message-ID: <8738rpq9fr.fsf@gmail.com> (raw)
In-Reply-To: 87sizpf8jx.fsf@gmail.com

Jambunathan K <kjambunathan@gmail.com> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>> You don't need `org-data' type. The tree root doesn't have any property
>>> anyway.
>>
>> I used that because I wanted the whole parse-tree as return value, but
>> no matter what `org-element-map' returns, it changes the parse-tree by
>> side-effects anyway, so I can just ignore the return value and use the
>> modified parse-tree stored somewhere instead - right?
>
> I have a hard time trying to imagine what you are trying to do.  You
> should try to explain to us what you are trying to accomplish.
>
>     Why are you storing a parse-tree?

I'm transforming a parse tree for my needs, using `org-element-map', but
since this functions returns what it mapped and, as Nicolas pointed out,
its kind of fruitless to map top-level 'org-data type (since it has no
property list), I store the parse-tree in some global variable that
gives me easy access to the whole (modified) parse-tree. 

But its not really about storing something, thats just for convenience. I
can (and do) wrap `org-element-map' into a function that receives a
complete parse-tree and returns a complete parse-tree after modifying
some parts of it (without storing something).

>     What does the parse-tree store?

its just about a complete parse-tree as produced by
`org-element-parse-buffer' transformed into a different syntax in
several steps.

>     Does the buffer of which it is a representation change, when the parse
>     tree changes.

no, the parse-tree is only prepared to be digested by a different
programming-language. 

>     How are you trying to "use" the parse tree?  Is it meant for one-way
>     or two-way conversion - i.e., interpretation or exportation.

in the end it will be used for two-way conversion, but I'm still working
on the "from-elisp-to-..." part (while learning how the org-mode parser
and the export framework work).

I don't want to talk too much about the project until I know its going
to work out. When there is something tangible I will announce it...

-- 
cheers,
Thorsten

      reply	other threads:[~2013-07-08 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06 14:38 Can `org-element-map' act on secondary-strings? Thorsten Jolitz
2013-07-06 17:14 ` Nicolas Goaziou
2013-07-08  7:16   ` Thorsten Jolitz
2013-07-08  7:39     ` Nicolas Goaziou
2013-07-08 12:06       ` Thorsten Jolitz
2013-07-08 13:00         ` Nicolas Goaziou
2013-07-08 13:48           ` Thorsten Jolitz
2013-07-08 14:08             ` Jambunathan K
2013-07-08 16:54               ` Thorsten Jolitz [this message]

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=8738rpq9fr.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).