From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: after-todo-statistics hook for checkboxes Date: Sat, 18 Oct 2014 09:31:55 +0200 Message-ID: <87wq7x3kb8.fsf@nicolasgoaziou.fr> References: <87a94xk2ts.wl-jamshark70@qq.com> <20141015213843.6003d235@hjh-e431> <877g014fbp.fsf@nicolasgoaziou.fr> <1491662d440.27cd.0bb60a3c7e492ea180363c67eb170725@qq.com> <87tx342ckt.fsf@nicolasgoaziou.fr> <87a94vegzv.wl-jamshark70@qq.com> <87r3y61m6b.fsf@nicolasgoaziou.fr> <8761fidsn4.wl-jamshark70@qq.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfOTw-0002z5-Nl for emacs-orgmode@gnu.org; Sat, 18 Oct 2014 03:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfOTp-00021p-Tu for emacs-orgmode@gnu.org; Sat, 18 Oct 2014 03:31:20 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:60658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfOTp-00021h-No for emacs-orgmode@gnu.org; Sat, 18 Oct 2014 03:31:13 -0400 In-Reply-To: <8761fidsn4.wl-jamshark70@qq.com> (James Harkins's message of "Sat, 18 Oct 2014 10:21:51 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: emacs-orgmode@gnu.org James Harkins 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