From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eddward DeVilla Subject: Re: Re: checkbox statistics (fixed version) Date: Sat, 9 May 2009 15:47:51 -0500 Message-ID: References: <87iqky8erm.fsf@gmail.com> <6B91D94A-35ED-493C-B11F-538EE0F78EFF@gmail.com> <8763gu8atv.fsf_-_@gmail.com> <79AB1A11-3CDC-4532-AFAC-8E466F5146C9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2tSg-0000nC-OG for emacs-orgmode@gnu.org; Sat, 09 May 2009 16:47:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2tSb-0000mz-7L for emacs-orgmode@gnu.org; Sat, 09 May 2009 16:47:57 -0400 Received: from [199.232.76.173] (port=60272 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2tSb-0000mw-1L for emacs-orgmode@gnu.org; Sat, 09 May 2009 16:47:53 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:37397) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M2tSa-0004uF-IS for emacs-orgmode@gnu.org; Sat, 09 May 2009 16:47:52 -0400 Received: by ewy6 with SMTP id 6so2739424ewy.42 for ; Sat, 09 May 2009 13:47:51 -0700 (PDT) In-Reply-To: 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: Carsten Dominik Cc: emacs-orgmode@gnu.org, Richard KLINDA The behaviour of the [/] token counter all of it decendents and not just it's immediate children. I under stand it's not ideal in the case of [-] tokens or position that could get [-] tokens, but I still prefer being able to collapse a list and still being able to tell roughly how much is left to do under it. So given something like the example we've been working with but with org's current behaviour... * test [3/4] - [X] one - [X] two - [X] three - [-] four - [ ] five - [ ] six - [ ] seven - [ ] eight - [ ] nine If I collapse test and just scan the file, I would think I'm mostly done. With the older behaviour I could have done something more like... * test [3/7] - [X] one - [X] two - [X] three - [0/4] four - [ ] five - [0/3] six - [ ] seven - [ ] eight - [ ] nine I would realized that there was a bit more to do and maybe I should expand that tree an inspect it a bit more. I use collapsible lists and I tend to set up large lists. This behaviour works a lot better for me. Edd On Sat, May 9, 2009 at 1:56 AM, Carsten Dominik wrote: > > On May 9, 2009, at 1:50 AM, Eddward DeVilla wrote: > >> That's true, but to be honest, before I knew about the [-] feature, I >> used [/] tokens on list items with checkboxes under them. =A0I'd >> consider this an improvement. > > Consider what exactly an improvement? > > - Carsten > >> >> Edd >> >> On Fri, May 8, 2009 at 10:27 AM, Carsten Dominik >> wrote: >>> >>> Hi Richard, >>> >>> your patch works, almost. >>> >>> Where it goes wrong is here: >>> >>> * test [3/6] >>> =A0- one >>> =A0- [X] two >>> =A0- three >>> =A0- [-] four >>> =A0 - [X] five >>> =A0 - [-] six >>> =A0 =A0 - seven >>> =A0 =A0 - [ ] eight >>> =A0 =A0 - [X] nine >>> >>> >>> The statistics cookie talks about 6 checkboxes below it, >>> but in fact there are only 4, two (at "four" and "six") >>> are a "summary" checkboxes. >>> So we get the funny effect that toggling "eight" will make >>> the cookie jump from 3/6 directly to 6/6 .... >>> >>> Maybe this is acceptable, because the "summary" checkboxes don't really >>> make sense when the statistics covers the entire tree.... >>> >>> Opinions? >>> >>> - Carsten >>> >>> On Apr 24, 2009, at 3:01 PM, Richard KLINDA wrote: >>> >>>> This is the fixed patch, it actually works on my real life org files s= o >>>> this has a slight chance of being right. >>>> >>>>> >>>>> ---------------------------------------------------------------------= --- >>>> >>>> diff --git a/lisp/org-list.el b/lisp/org-list.el >>>> index 7469add..872dddf 100644 >>>> --- a/lisp/org-list.el >>>> +++ b/lisp/org-list.el >>>> @@ -110,6 +110,9 @@ with \\[org-ctrl-c-ctrl-c\\]." >>>> =A0:group 'org-plain-lists >>>> =A0:type 'boolean) >>>> >>>> +(defcustom org-recursive-checkbox-statistics nil >>>> + =A0"Non-nil means, that checkbox counting should happen recursively.= ") >>>> + >>>> (defcustom org-description-max-indent 20 >>>> =A0"Maximum indentation for the second line of a description list. >>>> When the indentation would be larger than this, it will become >>>> @@ -402,7 +405,10 @@ the whole buffer." >>>> =A0 =A0 =A0 =A0 =A0 =A0 (org-beginning-of-item) >>>> =A0 =A0 =A0 =A0 =A0 =A0 (setq curr-ind (org-get-indentation)) >>>> =A0 =A0 =A0 =A0 =A0 =A0 (setq next-ind curr-ind) >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0(while (and (bolp) (org-at-item-p) (=3D c= urr-ind next-ind)) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(while (and (bolp) (org-at-item-p) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if org-recur= sive-checkbox-statistics >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(<=3D= curr-ind next-ind) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(=3D = curr-ind next-ind))) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (save-excursion (end-of-line) (setq eline = (point))) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if (re-search-forward re-box eline t) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if (member (match-string 2) '("[ = ]" "[-]")) >>>> @@ -410,7 +416,12 @@ the whole buffer." >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq c-on (1+ c-on)) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ) >>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-end-of-item) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if org-recursive-checkbox-statis= tics >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(progn >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(end-of-line) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(when (re-search-forw= ard org-list-beginning-re >>>> lim t) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(beginning-of-lin= e))) >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-end-of-item)) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq next-ind (org-get-indentation)) >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ))) >>>> =A0 =A0 =A0 (goto-char continue-from) >>>> >>>>> >>>>> ---------------------------------------------------------------------= --- >>>> >>>> -- >>>> Richard >>>> >>>> >>>> _______________________________________________ >>>> Emacs-orgmode mailing list >>>> Remember: use `Reply All' to send replies to the list. >>>> Emacs-orgmode@gnu.org >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Remember: use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> > >