emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: James Harkins <jamshark70@qq.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: after-todo-statistics hook for checkboxes
Date: Sat, 18 Oct 2014 09:31:55 +0200	[thread overview]
Message-ID: <87wq7x3kb8.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <8761fidsn4.wl-jamshark70@qq.com> (James Harkins's message of "Sat, 18 Oct 2014 10:21:51 +0800")

James Harkins <jamshark70@qq.com> writes:

> So let me update my issue report/feature request:
>
> -- If there is a hook to do something after updating todo statistics,
> then it would make sense to have a hook for updating checkbox
> statistics as well. That hook should be called with the same arguments
> (n-done n-not-done) so that the user could use one function for both,
> if desired.
>
> I can do this pretty easily and update the documentation. I don't have
> FSF papers signed, but I'm willing to get that ball rolling as well.
>
> But before spending any time on that, I want to ask if this is okay.
> I understand the objection against pressing
> org-after-todo-statistics-hook into service for checkboxes. If there's
> an objection against simply *having* a hook for checkboxes, I'm afraid
> I don't understand that.

I have no objection to this.

Note that this hook can be tricky to use because checkboxes are local to
the list. So adding a global effect to it (e.g., switching TODO state)
will sometimes fail. In the following example

  * Headline
  - [X] list1:item 1
  - [ ] list1:item 2

  Paragraph

  - [ ] list2:item 1
  - [ ] list2:item 2

checking "list1:item 2" will trigger the hook with (2 2) as arguments,
which may be surprising. I suggest to add a word of warning in the
documentation.

Thanks for working on it.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2014-10-18  7:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 11:08 after-todo-statistics hook for checkboxes James Harkins
2014-10-15 13:38 ` James Harkins
2014-10-15 13:45   ` Nicolas Goaziou
     [not found]     ` <1491661ce88.27cd.0bb60a3c7e492ea180363c67eb170725@qq.com>
2014-10-16  1:01       ` James Harkins
2014-10-16 16:39         ` Nicolas Goaziou
2014-10-16 23:23           ` James Harkins
2014-10-17 20:22             ` Nicolas Goaziou
2014-10-18  2:21               ` James Harkins
2014-10-18  7:31                 ` Nicolas Goaziou [this message]
2014-10-20 12:46                   ` Bastien

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=87wq7x3kb8.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=jamshark70@qq.com \
    /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).