orgmode auto-update todo-count

Table of Contents

I have an orgmode item that looks like this:

** STARTED [#A] Planning, Emails & Social [48/56]
   <2020-03-23 Mon 08:15-09:00 +1d>

This item is a target for my capture-from-email, so TODO items are constantly added beneath. The result is that the count always end up as [0/0] in my agenda until I manually visit the headline and do a C-c # to update it to the proper count; I’m not sure why this is, but I would love to fix it somehow. Suggestions from r/emacs led me to an answer.

Answer

(defun tsa/org-auto-check()
  (org-update-statistics-cookies "ALL"))

(add-hook 'org-capture-before-finalize-hook 'tsa/org-auto-check)

Resources

Tory Anderson avatar
Tory Anderson
Web App Engineer, Digital Humanist, Researcher, Computer Psychologist