emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Ellis <ddellis914@gmail.com>
To: emacs-orgmode@gnu.org
Subject: checklist and org-after-todo-statistics-hook
Date: Thu, 25 Mar 2010 13:14:53 -0500	[thread overview]
Message-ID: <6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2741 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

             reply	other threads:[~2010-03-25 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 18:14 David Ellis [this message]
2010-03-29  9:42 ` checklist and org-after-todo-statistics-hook Carsten Dominik
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=6dffa35e1003251114h35521edei1c608341bcb4bc30@mail.gmail.com \
    --to=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).