org-list: update cookies in special contexts

* lisp/org-list.el (org-update-checkbox-count): when a part of the
  buffer is processed to count checkboxes, lists are read from top to
  bottom, but inside lists (in drawers, blocks, or inline tasks) are
  skipped. Thus, cookies cannot be updated. This patch enforces
  reading of such lists if counter is itself in a special context.
This commit is contained in:
Nicolas Goaziou 2011-01-27 21:11:47 +01:00
parent f7ebd6bcf0
commit e5a61ab260
1 changed files with 3 additions and 1 deletions

View File

@ -2229,7 +2229,9 @@ With optional prefix argument ALL, do this for the whole buffer."
;; Cookie is at an item, and we already have list
;; structure stored in STRUCTS-BAK.
((and (org-at-item-p)
(< (point-at-bol) backup-end))
(< (point-at-bol) backup-end)
;; Only lists in no special context are stored.
(not (nth 2 (org-list-context))))
(funcall count-boxes (point-at-bol) structs-bak recursivep))
;; Cookie is at an item, but we need to compute list
;; structure.