浏览代码

Correctly find unchecked boxes in a section

* lisp/org.el (org-block-todo-from-checkboxes):
  `org-list-search-forward' should be used when looking for an item,
  as it filters out contexts where match couldn't be in
  a list (i.e. example blocks). Also use a correct item regexp, taking
  into account alphabetical ordered lists and counters.
Nicolas Goaziou 13 年之前
父节点
当前提交
25131410f4
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      lisp/org.el

+ 5 - 2
lisp/org.el

@@ -11367,8 +11367,11 @@ changes because there are unchecked boxes in this entry."
 	  (outline-next-heading)
 	  (setq end (point))
 	  (goto-char beg)
-	  (if (re-search-forward "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\[[- ]\\]"
-				 end t)
+	  (if (org-list-search-forward
+	       (concat (org-item-beginning-re)
+		       "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?"
+		       "\\[[- ]\\]")
+	       end t)
 	      (progn
 		(if (boundp 'org-blocked-by-checkboxes)
 		    (setq org-blocked-by-checkboxes t))