emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Headline text special property


From: Thorsten Jolitz
Subject: Re: [O] Headline text special property
Date: Tue, 16 Sep 2014 18:36:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Brett Witty <address@hidden> 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 via email to

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