From mboxrd@z Thu Jan 1 00:00:00 1970 From: mrb@hsdev.com Subject: Re: Automatic tagging based on # of todo items as children Date: Wed, 17 Feb 2010 18:43:42 +0100 Message-ID: <20100217184342.3d4d5d06@hsdev.com> References: <20100215120548.6ef57e56@hsdev.com> <9F69ED3D-EF2E-4166-91D4-A2A102479268@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0356486607==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhnwE-0001z6-VZ for emacs-orgmode@gnu.org; Wed, 17 Feb 2010 12:43:51 -0500 Received: from [140.186.70.92] (port=32991 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhnwD-0001yh-3O for emacs-orgmode@gnu.org; Wed, 17 Feb 2010 12:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhnwA-0003zI-0u for emacs-orgmode@gnu.org; Wed, 17 Feb 2010 12:43:48 -0500 Received: from router2.hsdev.com ([212.61.102.6]:55103 helo=MrB.local) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhnw9-0003yw-GK for emacs-orgmode@gnu.org; Wed, 17 Feb 2010 12:43:45 -0500 In-Reply-To: <9F69ED3D-EF2E-4166-91D4-A2A102479268@gmail.com> 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: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============0356486607== Content-Type: multipart/signed; micalg=SHA1; boundary="Sig_/xNP60u33SKMDjMvM27peRby"; protocol="application/pkcs7-signature" --Sig_/xNP60u33SKMDjMvM27peRby Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue 16-Feb-2010 05:53 Carsten Dominik wrote: > there is not simple other way, because only when making TODO =20 > statistics are the TODO children counted. You can hook into `org-=20 > after-todo-state-change-hook' with a function that moves back up to =20 > the parent and then counts children with TODO keyword. >=20 > THis is untested: >=20 > (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)))))) >=20 > (add-hook 'org-after-todo-state-change-hook 'my-define-prj) >=20 Thanks! That is close enough at this time. It neatly adds/removes the tag when there are more/less than 2 open TODO items. =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_/xNP60u33SKMDjMvM27peRby 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 kY4DE7KiLROtT6RSnhfORjQ70rkBOYZxQhEG6Loc9Ez2j13GNe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COuShrV9uRaRU/RYr1KJ5MUjOhdqWoOyR5z/4gJ6o1z AMnWSCWmxXOiaJpqkMCgfly6ablwAx6NIANEi+7O8964zi//f01DkupimIYKflp9 QO1kGqincb2gMAEl3MDSl6DwEUFz2NW0JohWo4CKo5tqu6vTkQUxe9m7M/YLG76a DfmrIvDENeoKR1bdKmUFMj3Md22a/xn/DhnByO229225s4BXYm2BdWXTe7iaAAAA AAAA --Sig_/xNP60u33SKMDjMvM27peRby-- --===============0356486607== 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 --===============0356486607==--