From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: checklist and org-after-todo-statistics-hook Date: Mon, 29 Mar 2010 13:28:33 +0200 Message-ID: <3CC8C428-5CD8-4CE0-8055-BCFEAD8792B2@gmail.com> References: <6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwD9H-0007cY-0B for emacs-orgmode@gnu.org; Mon, 29 Mar 2010 07:28:51 -0400 Received: from [140.186.70.92] (port=52191 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwD9E-0007b2-7a for emacs-orgmode@gnu.org; Mon, 29 Mar 2010 07:28:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwD9C-0001Pt-QB for emacs-orgmode@gnu.org; Mon, 29 Mar 2010 07:28:48 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:60326) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwD9C-0001O6-79 for emacs-orgmode@gnu.org; Mon, 29 Mar 2010 07:28:46 -0400 Received: by mail-ew0-f223.google.com with SMTP id 23so2203126ewy.14 for ; Mon, 29 Mar 2010 04:28:45 -0700 (PDT) In-Reply-To: <6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.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: David Ellis Cc: emacs-orgmode@gnu.org On Mar 25, 2010, at 7:14 PM, David Ellis wrote: > 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? Hi Dave, there is a separate for this situation: org-checkbox-statistics-hook HTH - Carsten