[Top][All Lists]

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

Re: [O] Counting number of children under heading

From: Eric Abrahamsen
Subject: Re: [O] Counting number of children under heading
Date: Thu, 17 Apr 2014 18:55:27 +0800
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3 (gnu/linux)

Marvin Doyley <address@hidden> writes:

> Hi there,
> I would like to automatically count the number of children under a given 
> heading. For example, I would like to have
> * Cars (2)
> ** BMW
> ** Escort
>  Putting  [/] at the end of header (in this case Cars), then putting the TODO 
> keyword before each sub-header give me a partial solution
> * Cars [/]
> ** TODO Escort
> Is there way to do this without using the TODO keyword ?
> Thanks,
> M

I could have sworn someone posted a thing for this just a week or two
ago, using `org-map-entries' and the identity function, and counting the
results. Anyway look at the docstring for `org-map-entries', it takes a
SCOPE argument you can set to 'tree to just map the headings under the
current one. A stupid example might look like:

(apply '+ (org-map-entries (lambda () 1) t 'tree))

Though that will count the top-level heading, as well.


reply via email to

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