瀏覽代碼

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 年之前
父節點
當前提交
e5a61ab260
共有 1 個文件被更改,包括 3 次插入1 次删除
  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.