org-list: update statistical cookies with check-boxes in an hidden subtree

* lisp/org-list.el (org-update-checkbox-count): Ensure cookies on an
  heading are correctly updated when checkboxes are hidden. It allows,
  for example, to use C-c C-x C-b on a collapsed tree and still get
  the update.
This commit is contained in:
Nicolas Goaziou 2011-03-06 21:32:06 +01:00
parent 3e06bae09b
commit 38877e6cf9
1 changed files with 1 additions and 1 deletions

View File

@ -2173,7 +2173,7 @@ With optional prefix argument ALL, do this for the whole buffer."
(or (org-entry-get nil "COOKIE_DATA") ""))))
(bounds (if all
(cons (point-min) (point-max))
(cons (or (ignore-errors (org-back-to-heading) (point))
(cons (or (ignore-errors (org-back-to-heading t) (point))
(point-min))
(save-excursion (outline-next-heading) (point)))))
(count-boxes