With this:
* Cookie counter [0/2]
- [ ] Item 1
- [ ] Item 2
I can count the number of list items or TODO items.
But what if I just want to count the number of subheadings? Is it possible to get something like this:
* Cookie counter [2]
** Item 1
** Item 2
So, I wrote a function as follows:
(defun my-no-of-headings ()
(interactive)
(save-excursion
(length (org-map-entries t t 'tree))))
But when I execute it at the beginning of the heading, it does not display the number of subheadings.
What do I do to actually see the number of headings?
org-map-entries
and display the counts using an overlay (but org-mode uses overlays for its own purposes, so there might be conflicts).org-map-entries
in help but I am not able to grasp its use. Could you please expand your answer to include the specific way I need to use it? Will I need to write my own function that will useorg-map-entries
?