From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Witty Subject: Re: Headline text special property Date: Thu, 18 Sep 2014 21:28:06 +1000 Message-ID: References: <87tx47ikte.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158b6f2a549b0050355497f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUZtS-0007XZ-PC for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 07:29:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUZtR-0000rN-4E for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 07:28:58 -0400 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:32818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUZtP-0000qK-HD for emacs-orgmode@gnu.org; Thu, 18 Sep 2014 07:28:57 -0400 Received: by mail-la0-f45.google.com with SMTP id b17so926881lan.4 for ; Thu, 18 Sep 2014 04:28:46 -0700 (PDT) In-Reply-To: <87tx47ikte.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: Org mailing list --089e0158b6f2a549b0050355497f Content-Type: text/plain; charset=UTF-8 Thanks! It'd be nice if there was a way to turn this into a property for easy dynamic columnview blocks, but I guess you can't have everything :) BrettW On Wed, Sep 17, 2014 at 2:36 AM, Thorsten Jolitz wrote: > Brett Witty 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 > > > --089e0158b6f2a549b0050355497f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks! It'd be nice if there was a way to turn t= his into a=20 property for easy dynamic columnview blocks, but I guess you can't have= =20 everything :)

BrettW

On Wed, Sep 17, 2014 at 2:36 AM, Thorsten Jolitz <tj= olitz@gmail.com> wrote:
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
=C2=A0(outline-previous-heading)
=C2=A0 (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
=C2=A0(outline-previous-heading)
=C2=A0 (org-get-heading t t))
#+END_SRC

#+results:
: Test

--
cheers,
Thorsten



--089e0158b6f2a549b0050355497f--