Browse Source

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.
Nicolas Goaziou 15 năm trước cách đây
mục cha
commit
e5a61ab260
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      lisp/org-list.el

+ 3 - 1
lisp/org-list.el

@@ -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.