emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: checkbox statistics (fixed version)


From: Eddward DeVilla
Subject: Re: [Orgmode] Re: checkbox statistics (fixed version)
Date: Sat, 9 May 2009 15:47:51 -0500

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
<address@hidden> 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
>> <address@hidden> 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.
>>>> address@hidden
>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Remember: use `Reply All' to send replies to the list.
>>> address@hidden
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]