On Tue 16-Feb-2010 05:53 Carsten Dominik wrote: > there is not simple other way, because only when making TODO > statistics are the TODO children counted. You can hook into `org- > after-todo-state-change-hook' with a function that moves back up to > the parent and then counts children with TODO keyword. > > THis is untested: > > (defun my-define-prj () > (save-excursion > (when (org-up-heading-safe) > (let ((beg (point)) > (end (org-end-of-subtree t t)) > two-not-done) > (goto-char beg) > (goto-char (point-at-eol)) > (setq two-not-done > (and (re-search-forward org-not-done-heading-regexp end > t) (re-search-forward org-not-done-heading-regexp end t))) > (goto-char beg) > (org-toggle-tag "prj" (if two-not-done 'on 'off)))))) > > (add-hook 'org-after-todo-state-change-hook 'my-define-prj) > Thanks! That is close enough at this time. It neatly adds/removes the tag when there are more/less than 2 open TODO items. marcel -- Marcel van der Boom -- http://hsdev.com/mvdb.vcf HS-Development BV -- http://www.hsdev.com So! web applications -- http://make-it-so.info Cobra build -- http://cobra.mrblog.nl