emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Can `org-element-map' act on secondary-strings?


From: Nicolas Goaziou
Subject: Re: [O] Can `org-element-map' act on secondary-strings?
Date: Mon, 08 Jul 2013 09:39:32 +0200

Hello,

Thorsten Jolitz <address@hidden> writes:

> I meant these strings that I find in parse-trees that apparently do have a
> parent-proptery:
>
> #+begin_src emacs-lisp
> (headline ... :title (#("topic number one" 0 16 (:parent #1))))
>
> (paragraph (:begin 114 ...)
> #("Hello subtopic number one " 0 26 (:parent #4)))
> #+end_src

All strings contained in an element or a secondary string have a parent
property.  Try 

  (org-element-map (org-element-parse-buffer) 'plain-text 'identity)

on the following Org buffer

  #+begin_src org
  * A
  B
  #+end_src

> I concluded that they are the secondary values listed here:

No. The secondary values are lists: "topic number one", which has
a :parent property, belongs to a list stored in :title property.  That
list is the secondary value.

> I can change the :parent attribute of the headline containing the above
> :title string (or of the paragraph containing the above content string)
> with `org-element-map', but those :parent references inside the strings
> remain untouched.

Why would they be changed? The :parent reference in the headline is
another headline, or the full tree whereas the :parent reference in
these strings is the headline itself. IOW, they are unrelated.

> I can access them by writing some code, of course, I only wanted to know if
> `org-element-map' might be able to access them out-of-the-box somehow.

As said in my previous post, `org-element-map' can access them.

Do you have a simple example showing what you want to achieve?


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]