emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Automatic tagging based on # of todo items as children


From: mrb
Subject: [Orgmode] Automatic tagging based on # of todo items as children
Date: Mon, 15 Feb 2010 12:05:48 +0100

Hi,

I would like to have org-mode assist me in tagging headlines with a
'prj' tag if that headline contains more than one todo item. It does
not matter if the items are completed or not, if it has more than one
task as its children, I would like to have it tagged with 'prj'

I came up with this:

#+begin_src elisp
(defun ensure-prj-tag()
  "Ensure a header gets a prj tag" 
  (interactive) 
  (org-toggle-tag "prj"
    (if (> (length (org-map-entries t "/+TODO|DONE|CANCELLED" 'tree))1)
'on 'off)) )
#+end_src

which sort-of works if the cursor is on the heading.

I need some help with the following:
- I would like it to be automatic and the org-todo-statistics hook
  seem candidates to attach a function to, but I also want it for
  heading which do not have a [1/N] or [%] counter. How to proceed?
- Can I do this automatically on a whole file? 

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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