all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Get the text of a node
@ 2019-10-23  8:54 Joost Kremers
  2019-10-23 17:01 ` Jeff Filipovits
  2019-10-23 22:43 ` Sebastian Miele
  0 siblings, 2 replies; 3+ messages in thread
From: Joost Kremers @ 2019-10-23  8:54 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I was wondering if there's a way to programmatically get the text 
of a node in an Org buffer. Basically, I have a buffer that looks 
something like this:

#+BEGIN_SRC org
* Top header
** Subheader
   :PROPERTIES:
   :Custom_ID: some_id
   :END:

   Text starts here, possibly with additional subheaders
#+END_SRC

What I would like to extract is the text below "Subheader", but 
without the :PROPERTIES: block.

I've looked at the org-element library, but I haven't been able to 
figure out how to use it to extract just the plain text.

I use the :Custom_ID: property to find the relevant subheading and 
I know I can use (org-back-to-heading) to get point to the 
Subheader containing the relevant :PROPERTIES: block. Obviously, I 
could then narrow the buffer to the subheader, use a text search 
to move point past the line containing :END: and then extract the 
text from there until (point-max).

I'm just wondering if this may break in unexpected circumstances 
and whether there's a better way.

TIA

Joost



-- 
Joost Kremers
Life has its moments

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-23 22:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-23  8:54 Get the text of a node Joost Kremers
2019-10-23 17:01 ` Jeff Filipovits
2019-10-23 22:43 ` Sebastian Miele

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.