From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel van der Boom Subject: Automatic tagging based on # of todo items as children Date: Mon, 15 Feb 2010 11:27:07 +0100 Message-ID: <20100215112707.3baf82a0@hsdev.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1415891068==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NgyAc-0001fN-Jp for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 05:27:14 -0500 Received: from [140.186.70.92] (port=52249 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgyAb-0001fD-Ny for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 05:27:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NgyAZ-0002iF-0e for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 05:27:13 -0500 Received: from router2.hsdev.com ([212.61.102.6]:62584 helo=MrB.local) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NgyAY-0002i1-Je for emacs-orgmode@gnu.org; Mon, 15 Feb 2010 05:27:10 -0500 Received: from hsdev.com (localhost [127.0.0.1]) by MrB.local (Postfix) with ESMTP id 74043674377 for ; Mon, 15 Feb 2010 11:27:08 +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 --===============1415891068== Content-Type: multipart/signed; micalg=SHA1; boundary="Sig_/Oe9/AHtz2.p00RdPFHcsHw+"; protocol="application/pkcs7-signature" --Sig_/Oe9/AHtz2.p00RdPFHcsHw+ 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_/Oe9/AHtz2.p00RdPFHcsHw+ 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+kaOc1X11gWXCP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+8dcGJZTmXmW+7QyrdrTWaxuj6pNzhVcqLBW8gzzwaaZYo78O9zfI+CCp rt7NXTSRj5y97+frRvuNbnCZVxT4BTPyYlM3oIQrgBEghacIlApB4I9ebBGxAAAA AAAA --Sig_/Oe9/AHtz2.p00RdPFHcsHw+-- --===============1415891068== 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 --===============1415891068==--