* checkbox statistics @ 2009-04-21 10:47 Richard KLINDA 2009-04-21 12:26 ` Carsten Dominik 0 siblings, 1 reply; 14+ messages in thread From: Richard KLINDA @ 2009-04-21 10:47 UTC (permalink / raw) To: emacs-orgmode Hello, currently checkbox statistics only takes into account checkboxes on a single indent level. I would prefer checkbox statistics to show the total number of checkboxes below them, regardless of level. Currently: ,---- | ** TODO [0/2] job | 1) [-] 1 | * [X] a | * [X] b | * [X] c | * [ ] d | * [ ] e | 2) [-] 2 | * [X] a | * [X] b | * [ ] c `---- What I would like is: ,---- | ** TODO [5/10] job | 1) [-] 1 | * [X] a | * [X] b | * [X] c | * [ ] d | * [ ] e | 2) [-] 2 | * [X] a | * [X] b | * [ ] c `---- Is it possible somehow? Thanks, Richard ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: checkbox statistics 2009-04-21 10:47 checkbox statistics Richard KLINDA @ 2009-04-21 12:26 ` Carsten Dominik 2009-04-24 12:44 ` Richard KLINDA ` (3 more replies) 0 siblings, 4 replies; 14+ messages in thread From: Carsten Dominik @ 2009-04-21 12:26 UTC (permalink / raw) To: Richard KLINDA; +Cc: emacs-orgmode This is how it used to be a long time ago, and then we changed it, upon the request of several users. - Carsten On Apr 21, 2009, at 12:47 PM, Richard KLINDA wrote: > Hello, currently checkbox statistics only takes into account > checkboxes > on a single indent level. I would prefer checkbox statistics to show > the total number of checkboxes below them, regardless of level. > > Currently: > > ,---- > | ** TODO [0/2] job > | 1) [-] 1 > | * [X] a > | * [X] b > | * [X] c > | * [ ] d > | * [ ] e > | 2) [-] 2 > | * [X] a > | * [X] b > | * [ ] c > `---- > > What I would like is: > > ,---- > | ** TODO [5/10] job > | 1) [-] 1 > | * [X] a > | * [X] b > | * [X] c > | * [ ] d > | * [ ] e > | 2) [-] 2 > | * [X] a > | * [X] b > | * [ ] c > `---- > > Is it possible somehow? > > Thanks, > 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: checkbox statistics 2009-04-21 12:26 ` Carsten Dominik @ 2009-04-24 12:44 ` Richard KLINDA 2009-04-24 12:56 ` Richard KLINDA ` (2 subsequent siblings) 3 siblings, 0 replies; 14+ messages in thread From: Richard KLINDA @ 2009-04-24 12:44 UTC (permalink / raw) To: emacs-orgmode >>>>> Regarding 'Re: checkbox statistics'; Carsten Dominik adds: >> Hello, currently checkbox statistics only takes into account >> checkboxes on a single indent level. I would prefer checkbox >> statistics to show the total number of checkboxes below them, >> regardless of level. [...] > This is how it used to be a long time ago, and then we changed it, > upon the request of several users. Here is a patch to add support for the old way. Carsten, please include this if you find this acceptable, thanks. > ------------------------------------------------------------------------ diff --git a/lisp/org-list.el b/lisp/org-list.el index 7469add..d4c50e3 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -110,6 +110,9 @@ with \\[org-ctrl-c-ctrl-c\\]." :group 'org-plain-lists :type 'boolean) +(defcustom org-recursive-checkbox-statistics nil + "Non-nil means, that checkbox counting should happen recursively.") + (defcustom org-description-max-indent 20 "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." (org-beginning-of-item) (setq curr-ind (org-get-indentation)) (setq next-ind curr-ind) - (while (and (bolp) (org-at-item-p) (= curr-ind next-ind)) + (while (and (bolp) (org-at-item-p) + (if org-recursive-checkbox-statistics + (<= curr-ind next-ind) + (= curr-ind next-ind))) (save-excursion (end-of-line) (setq eline (point))) (if (re-search-forward re-box eline t) (if (member (match-string 2) '("[ ]" "[-]")) @@ -410,7 +416,9 @@ the whole buffer." (setq c-on (1+ c-on)) ) ) - (org-end-of-item) + (if org-recursive-checkbox-statistics + (forward-line 1) + (org-end-of-item)) (setq next-ind (org-get-indentation)) ))) (goto-char continue-from) > ------------------------------------------------------------------------ -- Richard ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: checkbox statistics 2009-04-21 12:26 ` Carsten Dominik 2009-04-24 12:44 ` Richard KLINDA @ 2009-04-24 12:56 ` Richard KLINDA 2009-04-24 17:37 ` Samuel Wales 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA 2009-04-26 18:05 ` checkbox statistics Marc Spitzer 3 siblings, 1 reply; 14+ messages in thread From: Richard KLINDA @ 2009-04-24 12:56 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode >>>>> Regarding 'Re: checkbox statistics'; Carsten Dominik adds: > This is how it used to be a long time ago, and then we changed it, > upon the request of several users. The patch I sent previously is bad, please ignore it. It needs more work (unfortunately). -- Udv, Richard ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics 2009-04-24 12:56 ` Richard KLINDA @ 2009-04-24 17:37 ` Samuel Wales 2009-04-25 8:21 ` Richard KLINDA 0 siblings, 1 reply; 14+ messages in thread From: Samuel Wales @ 2009-04-24 17:37 UTC (permalink / raw) To: Richard KLINDA; +Cc: emacs-orgmode Perhaps any such change should also change todo statistics for consistency? -- Myalgic encephalomyelitis denialism is causing death and severe suffering worse than MS. Greed is corrupting science into foul nonsense. Anybody can get the disease at any time permanently. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: checkbox statistics 2009-04-24 17:37 ` Samuel Wales @ 2009-04-25 8:21 ` Richard KLINDA 0 siblings, 0 replies; 14+ messages in thread From: Richard KLINDA @ 2009-04-25 8:21 UTC (permalink / raw) To: emacs-orgmode >>>>> Regarding 'Re: Re: checkbox statistics'; Samuel Wales adds: > Perhaps any such change should also change todo statistics for > consistency? I don't use todo statistics, but I'm going to take a look at that. -- Richard ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: checkbox statistics (fixed version) 2009-04-21 12:26 ` Carsten Dominik 2009-04-24 12:44 ` Richard KLINDA 2009-04-24 12:56 ` Richard KLINDA @ 2009-04-24 13:01 ` Richard KLINDA 2009-04-24 19:48 ` Eddward DeVilla ` (2 more replies) 2009-04-26 18:05 ` checkbox statistics Marc Spitzer 3 siblings, 3 replies; 14+ messages in thread From: Richard KLINDA @ 2009-04-24 13:01 UTC (permalink / raw) To: emacs-orgmode 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\\]." :group 'org-plain-lists :type 'boolean) +(defcustom org-recursive-checkbox-statistics nil + "Non-nil means, that checkbox counting should happen recursively.") + (defcustom org-description-max-indent 20 "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." (org-beginning-of-item) (setq curr-ind (org-get-indentation)) (setq next-ind curr-ind) - (while (and (bolp) (org-at-item-p) (= curr-ind next-ind)) + (while (and (bolp) (org-at-item-p) + (if org-recursive-checkbox-statistics + (<= curr-ind next-ind) + (= curr-ind next-ind))) (save-excursion (end-of-line) (setq eline (point))) (if (re-search-forward re-box eline t) (if (member (match-string 2) '("[ ]" "[-]")) @@ -410,7 +416,12 @@ the whole buffer." (setq c-on (1+ c-on)) ) ) - (org-end-of-item) + (if org-recursive-checkbox-statistics + (progn + (end-of-line) + (when (re-search-forward org-list-beginning-re lim t) + (beginning-of-line))) + (org-end-of-item)) (setq next-ind (org-get-indentation)) ))) (goto-char continue-from) > ------------------------------------------------------------------------ -- Richard ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA @ 2009-04-24 19:48 ` Eddward DeVilla 2009-05-08 15:27 ` Carsten Dominik 2009-05-10 7:17 ` Carsten Dominik 2 siblings, 0 replies; 14+ messages in thread From: Eddward DeVilla @ 2009-04-24 19:48 UTC (permalink / raw) To: Richard KLINDA; +Cc: emacs-orgmode I'll have to see if I can get this to work. I think I was one of the one that ask for the old behavior and have missed it ever since it was changed. Thanks! Edd On Fri, Apr 24, 2009 at 8:01 AM, Richard KLINDA <rklinda@gmail.com> 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\\]." > :group 'org-plain-lists > :type 'boolean) > > +(defcustom org-recursive-checkbox-statistics nil > + "Non-nil means, that checkbox counting should happen recursively.") > + > (defcustom org-description-max-indent 20 > "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." > (org-beginning-of-item) > (setq curr-ind (org-get-indentation)) > (setq next-ind curr-ind) > - (while (and (bolp) (org-at-item-p) (= curr-ind next-ind)) > + (while (and (bolp) (org-at-item-p) > + (if org-recursive-checkbox-statistics > + (<= curr-ind next-ind) > + (= curr-ind next-ind))) > (save-excursion (end-of-line) (setq eline (point))) > (if (re-search-forward re-box eline t) > (if (member (match-string 2) '("[ ]" "[-]")) > @@ -410,7 +416,12 @@ the whole buffer." > (setq c-on (1+ c-on)) > ) > ) > - (org-end-of-item) > + (if org-recursive-checkbox-statistics > + (progn > + (end-of-line) > + (when (re-search-forward org-list-beginning-re lim t) > + (beginning-of-line))) > + (org-end-of-item)) > (setq next-ind (org-get-indentation)) > ))) > (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 > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA 2009-04-24 19:48 ` Eddward DeVilla @ 2009-05-08 15:27 ` Carsten Dominik 2009-05-08 23:50 ` Eddward DeVilla 2009-05-10 7:17 ` Carsten Dominik 2 siblings, 1 reply; 14+ messages in thread From: Carsten Dominik @ 2009-05-08 15:27 UTC (permalink / raw) To: Richard KLINDA; +Cc: emacs-orgmode Hi Richard, your patch works, almost. Where it goes wrong is here: * test [3/6] - one - [X] two - three - [-] four - [X] five - [-] six - seven - [ ] eight - [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\\]." > :group 'org-plain-lists > :type 'boolean) > > +(defcustom org-recursive-checkbox-statistics nil > + "Non-nil means, that checkbox counting should happen recursively.") > + > (defcustom org-description-max-indent 20 > "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." > (org-beginning-of-item) > (setq curr-ind (org-get-indentation)) > (setq next-ind curr-ind) > - (while (and (bolp) (org-at-item-p) (= curr-ind next- > ind)) > + (while (and (bolp) (org-at-item-p) > + (if org-recursive-checkbox-statistics > + (<= curr-ind next-ind) > + (= curr-ind next-ind))) > (save-excursion (end-of-line) (setq eline (point))) > (if (re-search-forward re-box eline t) > (if (member (match-string 2) '("[ ]" "[-]")) > @@ -410,7 +416,12 @@ the whole buffer." > (setq c-on (1+ c-on)) > ) > ) > - (org-end-of-item) > + (if org-recursive-checkbox-statistics > + (progn > + (end-of-line) > + (when (re-search-forward org-list-beginning- > re lim t) > + (beginning-of-line))) > + (org-end-of-item)) > (setq next-ind (org-get-indentation)) > ))) > (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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-05-08 15:27 ` Carsten Dominik @ 2009-05-08 23:50 ` Eddward DeVilla 2009-05-09 6:56 ` Carsten Dominik 0 siblings, 1 reply; 14+ messages in thread From: Eddward DeVilla @ 2009-05-08 23:50 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode, 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 <carsten.dominik@gmail.com> wrote: > Hi Richard, > > your patch works, almost. > > Where it goes wrong is here: > > * test [3/6] > - one > - [X] two > - three > - [-] four > - [X] five > - [-] six > - seven > - [ ] eight > - [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\\]." >> :group 'org-plain-lists >> :type 'boolean) >> >> +(defcustom org-recursive-checkbox-statistics nil >> + "Non-nil means, that checkbox counting should happen recursively.") >> + >> (defcustom org-description-max-indent 20 >> "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." >> (org-beginning-of-item) >> (setq curr-ind (org-get-indentation)) >> (setq next-ind curr-ind) >> - (while (and (bolp) (org-at-item-p) (= curr-ind next-ind)) >> + (while (and (bolp) (org-at-item-p) >> + (if org-recursive-checkbox-statistics >> + (<= curr-ind next-ind) >> + (= curr-ind next-ind))) >> (save-excursion (end-of-line) (setq eline (point))) >> (if (re-search-forward re-box eline t) >> (if (member (match-string 2) '("[ ]" "[-]")) >> @@ -410,7 +416,12 @@ the whole buffer." >> (setq c-on (1+ c-on)) >> ) >> ) >> - (org-end-of-item) >> + (if org-recursive-checkbox-statistics >> + (progn >> + (end-of-line) >> + (when (re-search-forward org-list-beginning-re >> lim t) >> + (beginning-of-line))) >> + (org-end-of-item)) >> (setq next-ind (org-get-indentation)) >> ))) >> (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 > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-05-08 23:50 ` Eddward DeVilla @ 2009-05-09 6:56 ` Carsten Dominik 2009-05-09 20:47 ` Eddward DeVilla 0 siblings, 1 reply; 14+ messages in thread From: Carsten Dominik @ 2009-05-09 6:56 UTC (permalink / raw) To: Eddward DeVilla; +Cc: emacs-orgmode, Richard KLINDA 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. I'd > consider this an improvement. Consider what exactly an improvement? - Carsten > > Edd > > On Fri, May 8, 2009 at 10:27 AM, Carsten Dominik > <carsten.dominik@gmail.com> wrote: >> Hi Richard, >> >> your patch works, almost. >> >> Where it goes wrong is here: >> >> * test [3/6] >> - one >> - [X] two >> - three >> - [-] four >> - [X] five >> - [-] six >> - seven >> - [ ] eight >> - [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\\]." >>> :group 'org-plain-lists >>> :type 'boolean) >>> >>> +(defcustom org-recursive-checkbox-statistics nil >>> + "Non-nil means, that checkbox counting should happen >>> recursively.") >>> + >>> (defcustom org-description-max-indent 20 >>> "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." >>> (org-beginning-of-item) >>> (setq curr-ind (org-get-indentation)) >>> (setq next-ind curr-ind) >>> - (while (and (bolp) (org-at-item-p) (= curr-ind next- >>> ind)) >>> + (while (and (bolp) (org-at-item-p) >>> + (if org-recursive-checkbox-statistics >>> + (<= curr-ind next-ind) >>> + (= curr-ind next-ind))) >>> (save-excursion (end-of-line) (setq eline (point))) >>> (if (re-search-forward re-box eline t) >>> (if (member (match-string 2) '("[ ]" "[-]")) >>> @@ -410,7 +416,12 @@ the whole buffer." >>> (setq c-on (1+ c-on)) >>> ) >>> ) >>> - (org-end-of-item) >>> + (if org-recursive-checkbox-statistics >>> + (progn >>> + (end-of-line) >>> + (when (re-search-forward org-list- >>> beginning-re >>> lim t) >>> + (beginning-of-line))) >>> + (org-end-of-item)) >>> (setq next-ind (org-get-indentation)) >>> ))) >>> (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 >> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-05-09 6:56 ` Carsten Dominik @ 2009-05-09 20:47 ` Eddward DeVilla 0 siblings, 0 replies; 14+ messages in thread From: Eddward DeVilla @ 2009-05-09 20:47 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode, 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 <carsten.dominik@gmail.com> 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. I'd >> consider this an improvement. > > Consider what exactly an improvement? > > - Carsten > >> >> Edd >> >> On Fri, May 8, 2009 at 10:27 AM, Carsten Dominik >> <carsten.dominik@gmail.com> wrote: >>> >>> Hi Richard, >>> >>> your patch works, almost. >>> >>> Where it goes wrong is here: >>> >>> * test [3/6] >>> - one >>> - [X] two >>> - three >>> - [-] four >>> - [X] five >>> - [-] six >>> - seven >>> - [ ] eight >>> - [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\\]." >>>> :group 'org-plain-lists >>>> :type 'boolean) >>>> >>>> +(defcustom org-recursive-checkbox-statistics nil >>>> + "Non-nil means, that checkbox counting should happen recursively.") >>>> + >>>> (defcustom org-description-max-indent 20 >>>> "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." >>>> (org-beginning-of-item) >>>> (setq curr-ind (org-get-indentation)) >>>> (setq next-ind curr-ind) >>>> - (while (and (bolp) (org-at-item-p) (= curr-ind next-ind)) >>>> + (while (and (bolp) (org-at-item-p) >>>> + (if org-recursive-checkbox-statistics >>>> + (<= curr-ind next-ind) >>>> + (= curr-ind next-ind))) >>>> (save-excursion (end-of-line) (setq eline (point))) >>>> (if (re-search-forward re-box eline t) >>>> (if (member (match-string 2) '("[ ]" "[-]")) >>>> @@ -410,7 +416,12 @@ the whole buffer." >>>> (setq c-on (1+ c-on)) >>>> ) >>>> ) >>>> - (org-end-of-item) >>>> + (if org-recursive-checkbox-statistics >>>> + (progn >>>> + (end-of-line) >>>> + (when (re-search-forward org-list-beginning-re >>>> lim t) >>>> + (beginning-of-line))) >>>> + (org-end-of-item)) >>>> (setq next-ind (org-get-indentation)) >>>> ))) >>>> (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 >>> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Re: checkbox statistics (fixed version) 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA 2009-04-24 19:48 ` Eddward DeVilla 2009-05-08 15:27 ` Carsten Dominik @ 2009-05-10 7:17 ` Carsten Dominik 2 siblings, 0 replies; 14+ messages in thread From: Carsten Dominik @ 2009-05-10 7:17 UTC (permalink / raw) To: Richard KLINDA; +Cc: emacs-orgmode Hi Richard, I am accepting the patch, with one small change: The new variable is called `org-hierarchical-checkbox-statistics' and works the other way round, default t. Thanks. - 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\\]." > :group 'org-plain-lists > :type 'boolean) > > +(defcustom org-recursive-checkbox-statistics nil > + "Non-nil means, that checkbox counting should happen recursively.") > + > (defcustom org-description-max-indent 20 > "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." > (org-beginning-of-item) > (setq curr-ind (org-get-indentation)) > (setq next-ind curr-ind) > - (while (and (bolp) (org-at-item-p) (= curr-ind next- > ind)) > + (while (and (bolp) (org-at-item-p) > + (if org-recursive-checkbox-statistics > + (<= curr-ind next-ind) > + (= curr-ind next-ind))) > (save-excursion (end-of-line) (setq eline (point))) > (if (re-search-forward re-box eline t) > (if (member (match-string 2) '("[ ]" "[-]")) > @@ -410,7 +416,12 @@ the whole buffer." > (setq c-on (1+ c-on)) > ) > ) > - (org-end-of-item) > + (if org-recursive-checkbox-statistics > + (progn > + (end-of-line) > + (when (re-search-forward org-list-beginning- > re lim t) > + (beginning-of-line))) > + (org-end-of-item)) > (setq next-ind (org-get-indentation)) > ))) > (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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: checkbox statistics 2009-04-21 12:26 ` Carsten Dominik ` (2 preceding siblings ...) 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA @ 2009-04-26 18:05 ` Marc Spitzer 3 siblings, 0 replies; 14+ messages in thread From: Marc Spitzer @ 2009-04-26 18:05 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode, Richard KLINDA Would it be possible to have both behaviors? I could see times when both would be useful. For example I would find it very useful to see something like this: ** TODO [0/2] [5/10 s] saying that of 0 of my 2 major tasks are done and half of my leaf node tasks are done. The tralling 's' is for summery. The same for % done, perhaps something like '/s' and '%s' or '/+' and '%+' or just two new identifiers. marc On Tue, Apr 21, 2009 at 8:26 AM, Carsten Dominik <carsten.dominik@gmail.com> wrote: > This is how it used to be a long time ago, and then we > changed it, upon the request of several users. > > - Carsten > > > On Apr 21, 2009, at 12:47 PM, Richard KLINDA wrote: > >> Hello, currently checkbox statistics only takes into account checkboxes >> on a single indent level. I would prefer checkbox statistics to show >> the total number of checkboxes below them, regardless of level. >> >> Currently: >> >> ,---- >> | ** TODO [0/2] job >> | 1) [-] 1 >> | * [X] a >> | * [X] b >> | * [X] c >> | * [ ] d >> | * [ ] e >> | 2) [-] 2 >> | * [X] a >> | * [X] b >> | * [ ] c >> `---- >> >> What I would like is: >> >> ,---- >> | ** TODO [5/10] job >> | 1) [-] 1 >> | * [X] a >> | * [X] b >> | * [X] c >> | * [ ] d >> | * [ ] e >> | 2) [-] 2 >> | * [X] a >> | * [X] b >> | * [ ] c >> `---- >> >> Is it possible somehow? >> >> Thanks, >> 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 > -- Freedom is nothing but a chance to be better. Albert Camus ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2009-05-10 7:17 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-04-21 10:47 checkbox statistics Richard KLINDA 2009-04-21 12:26 ` Carsten Dominik 2009-04-24 12:44 ` Richard KLINDA 2009-04-24 12:56 ` Richard KLINDA 2009-04-24 17:37 ` Samuel Wales 2009-04-25 8:21 ` Richard KLINDA 2009-04-24 13:01 ` checkbox statistics (fixed version) Richard KLINDA 2009-04-24 19:48 ` Eddward DeVilla 2009-05-08 15:27 ` Carsten Dominik 2009-05-08 23:50 ` Eddward DeVilla 2009-05-09 6:56 ` Carsten Dominik 2009-05-09 20:47 ` Eddward DeVilla 2009-05-10 7:17 ` Carsten Dominik 2009-04-26 18:05 ` checkbox statistics Marc Spitzer
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).