Don't overlook checkboxes in ordered lists when updating statistics cookie

Manish writes:

> I noticed a small inconsistency.  If you start with following sample
> org file and press C-c C-c in the first cookie, it doesn't get updated
> correctly whereas the second one does.  The only difference is that
> one has children TODO tasks and the other has a list of checkboxes.
>
> Starting file:
>
> --8<---------------cut here---------------start------------->8---
> * Item 1 [/]
>  1. [X] line 1
>  2. [ ] line 2
> * Item 2 [/]
> *** TODO Sub-item 2.1
> *** DONE Sub-item 2.2
> --8<---------------cut here---------------end--------------->8---
>
> Status after C-c C-c in the summary cookie.
>
> --8<---------------cut here---------------start------------->8---
> * Item 1 [0/0]
>  1. [X] line 1
>  2. [ ] line 2
> * Item 2 [1/2]
> *** TODO Sub-item 2.1
> *** DONE Sub-item 2.2
> --8<---------------cut here---------------end--------------->8---
This commit is contained in:
Carsten Dominik 2010-01-08 08:33:16 +01:00
parent 8a3e6496de
commit f9eb4ee98c
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-01-08 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-update-statistics-cookies): Also see checkboxes in
ordered lists.
2010-01-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-view-mode-dispatch): Define the `L'

View File

@ -10302,8 +10302,9 @@ This should be called with the cursor in a line with a statistics cookie."
(outline-next-heading)
(if (org-on-heading-p) (setq l2 (org-outline-level)))
(point)))
(if (and (save-excursion (re-search-forward
"^[ \t]*[-+*] \\[[- X]\\]" end t))
(if (and (save-excursion
(re-search-forward
"^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t))
(not (save-excursion (re-search-forward
":COOKIE_DATA:.*\\<todo\\>" end t))))
(org-update-checkbox-count)