emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Richard Parsons <richard.lee.parsons@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Function to return content of item
Date: Sun, 07 May 2017 20:45:41 -0400	[thread overview]
Message-ID: <m2h90wjhvu.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <CAB+=1LFs1nwQUfbvwr9AzADe_kLaSxFjp+pBt7YPXoPSRQvy2A@mail.gmail.com>

I don't know of a function. Something like this may be what you want.
not all elements have :contents-begin though

(let ((el (org-element-context)))
 (buffer-substring-no-properties
 (org-element-property :contents-begin el)
 (org-element-property :contents-end el)))


It also a little tricky to figure out what to do about subheadings. Do
they count as content or not?

Richard Parsons writes:

> Hi there
>
> Is there a function that will give me the content of the current item? I
> mean simply the text of the whole item without its heading or properties
> drawer.
>
> It seems to me likely that such a function would exist, but I haven't been
> able to find it in the documentation.
>
> Many thanks
> Richard


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2017-05-08  0:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 23:04 Function to return content of item Richard Parsons
2017-05-08  0:45 ` John Kitchin [this message]
     [not found]   ` <CAB+=1LFbo7_nysB2TfcrDHZ87bjdMCEGAg5zu38nOi78qEbJ8g@mail.gmail.com>
2017-05-08 15:05     ` John Kitchin
2017-05-08 17:19       ` Richard Parsons

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=m2h90wjhvu.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lee.parsons@gmail.com \
    /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).