From mboxrd@z Thu Jan 1 00:00:00 1970 From: mrb@hsdev.com Subject: Automatic tagging based on # of todo items as children Date: Mon, 15 Feb 2010 12:05:48 +0100 Message-ID: <20100215120548.6ef57e56@hsdev.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0283195301==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ngym3-00089m-Se for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 06:05:55 -0500 Received: from [140.186.70.92] (port=58260 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ngym2-000898-MZ for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 06:05:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ngyly-0005eM-M4 for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 06:05:54 -0500 Received: from router2.hsdev.com ([212.61.102.6]:63329 helo=MrB.local) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ngyly-0005dq-An for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 06:05:50 -0500 Received: from hsdev.com (localhost [127.0.0.1]) by MrB.local (Postfix) with ESMTP id E8C8167548D for ; Mon, 15 Feb 2010 12:05:48 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0283195301== Content-Type: multipart/signed; micalg=SHA1; boundary="Sig_/OY/NwBKKvTbIfCdEE3aHXFP"; protocol="application/pkcs7-signature" --Sig_/OY/NwBKKvTbIfCdEE3aHXFP Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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"=20 (interactive)=20 (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?=20 marcel --=20 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 --Sig_/OY/NwBKKvTbIfCdEE3aHXFP Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAA oIIC3jCCAtowggJDoAMCAQICEG7P3/QGL8GKIh3AwtWsIKYwDQYJKoZIhvcNAQEF BQAwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQ dHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1 aW5nIENBMB4XDTA5MDUxOTA3MjgzOFoXDTEwMDUxOTA3MjgzOFowQjEfMB0GA1UE AxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEfMB0GCSqGSIb3DQEJARYQbWFyY2Vs QGhzZGV2LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALXhmENB kY4DE7KiLROtT6RSnhfORjQ70rkBOYZxQhEG6Loc9Ez2j13GNe3OZVprwCLWOabV pISYkBhBdRL6P6enpkI4eEzJyPqxqcKjXtdaLPVOaQpINkVgq6drrf/sj/ZbEUkH HTY63D5XIeRCEKxpwB2n+kaOc1X11gWXCPPmDAvb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4pgOgE5iJR6T3bfdrygYDiXJkndI7KSjX1yG0L2n1GJyoRu/PTuuITm JkdwAYQthnkwSwWLdVtI4JmLoA6PpQ4E7IJnPwTeN4mvIxFbgXpLKUv9TCJRAAAA AAAA --Sig_/OY/NwBKKvTbIfCdEE3aHXFP-- --===============0283195301== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0283195301==--