all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcel van der Boom <marcel@hsdev.com>
To: emacs-orgmode@gnu.org
Subject: Automatic tagging based on # of todo items as children
Date: Mon, 15 Feb 2010 11:27:07 +0100	[thread overview]
Message-ID: <20100215112707.3baf82a0@hsdev.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1089 bytes --]

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 #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1347 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2010-02-15 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 10:27 Marcel van der Boom [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-02-15 11:05 Automatic tagging based on # of todo items as children mrb
2010-02-16  4:53 ` Carsten Dominik
2010-02-17 17:43   ` mrb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100215112707.3baf82a0@hsdev.com \
    --to=marcel@hsdev.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.