emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: David Ellis <ddellis914@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: checklist and org-after-todo-statistics-hook
Date: Mon, 29 Mar 2010 11:42:38 +0200	[thread overview]
Message-ID: <195B9A2F-CD3C-4E39-A71E-ADFCB8B9E5DE@gmail.com> (raw)
In-Reply-To: <6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.gmail.com>


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

  reply	other threads:[~2010-03-29 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 18:14 checklist and org-after-todo-statistics-hook David Ellis
2010-03-29  9:42 ` Carsten Dominik [this message]
2010-03-29 11:28 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=195B9A2F-CD3C-4E39-A71E-ADFCB8B9E5DE@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=ddellis914@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).