summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-08-24 16:34:05 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-08-24 18:30:47 +0200
commit25131410f434fda91082d0b7b6d8066c41a1e259 (patch)
treeca4b5eb1122bafe9b861a9b49059763f115f187d
parent8b16fae47997c5b66510f8007364114adbee86eb (diff)
downloadorg-mode-25131410f434fda91082d0b7b6d8066c41a1e259.tar.gz
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.
-rw-r--r--lisp/org.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index bbc6a75..6ee3b4e 100644
--- a/lisp/org.el
+++ b/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))