From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ellis Subject: checklist and org-after-todo-statistics-hook Date: Thu, 25 Mar 2010 13:14:53 -0500 Message-ID: <6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0294197313==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nurg5-00086L-Mo for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 14:21:09 -0400 Received: from [140.186.70.92] (port=42978 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nurg3-0007xg-Qd for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 14:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nura3-00089p-Or for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 14:14:56 -0400 Received: from mail-iw0-f202.google.com ([209.85.223.202]:36067) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nura3-00089e-LM for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 14:14:55 -0400 Received: by iwn40 with SMTP id 40so1295367iwn.1 for ; Thu, 25 Mar 2010 11:14:54 -0700 (PDT) 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 --===============0294197313== Content-Type: multipart/alternative; boundary=0016e644dc60033f570482a40640 --0016e644dc60033f570482a40640 Content-Type: text/plain; charset=ISO-8859-1 I have the following in my .emacs file to automatically update the todo state of a parent todo based on the number of completed children. (defun org-summary-todo (n-done n-not-done) "Switch entry to DONE when all subentries are done, to TODO otherwise." (this is an unquoted list) (let (org-log-done org-log-states) ; turn off logging (org-todo (if (= n-not-done 0) "DONE" (if (= n-done 0) "TODO" "STARTED"))))) (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) I have started using checklists and notices that this hook does not get called when the statistics cookie is updated. For example, in the following, the parent todo state gets updated as the statistics cookie is updated: * STARTED Project 1 [1/3] ** DONE task 1 ** TODO task 2 ** TODO task 3 In the following example, the statistics are updated but the hook is not called * TODO Project 1 [1/3] - [X] task 1 - [ ] task 2 - [ ] task 3 Is it possible to change it to call the hook for the second example? Dave --0016e644dc60033f570482a40640 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have the following in my .emacs file to automatically update the todo sta= te of a parent todo based on the number of completed children.

(defun org-summary-todo (n-d= one n-not-done)
=A0 "Switch entry = to DONE when all subentries are done, to TODO otherwise."
=A0 (this is an unquoted list)
=A0 (let (org-log-done = org-log-states)=A0=A0 ; turn off logging
= =A0=A0=A0 (org-todo (if (=3D n-not-done 0)
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "DONE"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (if (=3D n-done 0) &qu= ot;TODO" "STARTED")))))

(add-hook 'org-after-todo-statistics-hook &#= 39;org-summary-todo)

I have started using checklists and noti= ces that this hook does not get called when the statistics cookie is update= d.

For example, in the following, the parent todo state gets updated as th= e statistics cookie is updated:

* STARTED Project 1 [1/3]
** DONE task 1** TODO task 2
** TODO task 3
In the following example, the statistics are updated but the hook is = not called

* TODO Project 1 [1= /3]
=A0=A0=A0 - [X]= task 1
=A0=A0=A0 - [ ] task 2<= /span>
=A0=A0=A0 - [ ] task 3


Is it possible to change it to call the hook for the second example?
Dave
--0016e644dc60033f570482a40640-- --===============0294197313== 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 --===============0294197313==--