From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eddward DeVilla Subject: Re: Re: checkbox statistics (fixed version) Date: Fri, 8 May 2009 18:50:16 -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 1M2Zpb-0001yY-5P for emacs-orgmode@gnu.org; Fri, 08 May 2009 19:50:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2Zpa-0001yF-OY for emacs-orgmode@gnu.org; Fri, 08 May 2009 19:50:18 -0400 Received: from [199.232.76.173] (port=52696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2Zpa-0001yA-Ey for emacs-orgmode@gnu.org; Fri, 08 May 2009 19:50:18 -0400 Received: from ey-out-1920.google.com ([74.125.78.144]:38824) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M2ZpZ-0005bk-Vl for emacs-orgmode@gnu.org; Fri, 08 May 2009 19:50:18 -0400 Received: by ey-out-1920.google.com with SMTP id 13so451327eye.24 for ; Fri, 08 May 2009 16:50:16 -0700 (PDT) In-Reply-To: <79AB1A11-3CDC-4532-AFAC-8E466F5146C9@gmail.com> 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 That's true, but to be honest, before I knew about the [-] feature, I used [/] tokens on list items with checkboxes under them. I'd consider this an improvement. 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 =A0- [X] five > =A0 =A0- [-] six > =A0 =A0 =A0- seven > =A0 =A0 =A0- [ ] eight > =A0 =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 so >> 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 =A0(org-beginning-of-item) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0(setq curr-ind (org-get-indentation)) >> =A0 =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 cur= r-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-recursi= ve-checkbox-statistics >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(<=3D c= urr-ind next-ind) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(=3D cu= rr-ind next-ind))) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(save-excursion (end-of-line) (setq eline= (point))) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (re-search-forward re-box eline t) >> =A0 =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 =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 =A0 =A0(org-end-of-item) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if org-recursive-checkbox-statisti= cs >> + =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-forwar= d org-list-beginning-re >> lim t) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(beginning-of-line)= )) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-end-of-item)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(setq next-ind (org-get-indentation)) >> =A0 =A0 =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 >