emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Headline text special property
Date: Tue, 16 Sep 2014 18:36:45 +0200	[thread overview]
Message-ID: <87tx47ikte.fsf@gmail.com> (raw)
In-Reply-To: CANK_Tn9mAVdNTyifg8VTh4DDL9Qr+Q=mZC2YVA6vdUSxi5CCng@mail.gmail.com

Brett Witty <brettwitty@brettwitty.net> writes:

Hi,

> Is there a special property that contains the text of a headline but
> not the stars, todo, tags or any of that other data?

not a property, but functions:

,----[ C-h f org-heading-components RET ]
| org-heading-components is a compiled Lisp function in `org.el'.
| 
| (org-heading-components)
| 
| Return the components of the current heading.
| This is a list with the following elements:
| - the level as an integer
| - the reduced level, different if `org-odd-levels-only' is set.
| - the TODO keyword, or nil
| - the priority character, like ?A, or nil if no priority is given
| - the headline text itself, or the tags string if no headline text
| - the tags string, or nil.
`----

* TODO Test :mytag:

#+BEGIN_SRC emacs-lisp
(save-excursion
 (outline-previous-heading)
  (nth 4 (org-heading-components)))
#+END_SRC

#+results:
: Test

or 

,----[ C-h f org-get-heading RET ]
| org-get-heading is a compiled Lisp function in `org.el'.
| 
| (org-get-heading &optional NO-TAGS NO-TODO)
| 
| Return the heading of the current entry, without the stars.
| When NO-TAGS is non-nil, don't include tags.
| When NO-TODO is non-nil, don't include TODO keywords.
`----

#+BEGIN_SRC emacs-lisp
(save-excursion
 (outline-previous-heading) 
  (org-get-heading t t)) 
#+END_SRC

#+results:
: Test

-- 
cheers,
Thorsten

  reply	other threads:[~2014-09-16 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 14:48 Headline text special property Brett Witty
2014-09-16 16:36 ` Thorsten Jolitz [this message]
2014-09-18 11:28   ` Brett Witty

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=87tx47ikte.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).