Orgmode: Show the number of children under the heading

I have a header in my orgmode file. It is automatically updated periodically with new children. I want the title bar to display the number of children.

So, if I have one child, he would say something like (1)

 * Heading (1) ** Subheading 

After it is updated with a different subtitle, the number should automatically be changed to (2)

 * Heading (2) ** Subheading ** A new added subheading 

I want this to be done because the top-level header usually crashes. I want to see if new children are added to it without the need for its expansion.

+5
source share
1 answer

What most closely resembles what you are looking for is called statistical cookies. They are described at the end of this page in the manual . At first intended for lists, but it is also possible to count headings. Just put [/] at the end of your header, for example:

 * Main header [/] ** sub-header 1 ** sub-header 2 ** sub-header 3 

And click Cc Cc in the cookie to update it (update its quantity). What you need to add to what you call your use case is the TODO keywords for your headers, because what cookies will count is how many of them are made. Therefore, I suggest you mark everything as DONE , for example:

 * Main header [3/3] ** DONE sub-header 1 ** DONE sub-header 2 ** DONE sub-header 3 

Then the counter will show you what you want.

Perhaps you could adjust the code for these cookies to meet your specific needs.

+5
source

All Articles