summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-01-19 14:37:16 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2013-01-19 14:37:16 (GMT)
commitf67370f6ea4de47919636e14cd82406fbd809035 (patch)
tree662e6b4bd5b8f9a623bd5702894ade838d43a573
parentbd779fad624af01dbcb35b381dee10452dc945b1 (diff)
downloadorg-mode-f67370f6ea4de47919636e14cd82406fbd809035.zip
org-mode-f67370f6ea4de47919636e14cd82406fbd809035.tar.gz
org-list: Fix bug when repairing checkbox with an ORDERED property
* lisp/org-list.el (org-list-struct-fix-box): When a checkbox has to be resetted because of a non-nil ORDERED property value, make sure it had a checkbox already.
-rw-r--r--lisp/org-list.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 78cb2a6..4747648 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1802,7 +1802,9 @@ This function modifies STRUCT."
;; There are boxes checked after an unchecked one: fix that.
(when (member "[X]" after-unchecked)
(let ((index (- (length struct) (length after-unchecked))))
- (mapc (lambda (e) (org-list-set-checkbox e struct "[ ]"))
+ (mapc (lambda (e)
+ (when (org-list-get-checkbox e struct)
+ (org-list-set-checkbox e struct "[ ]")))
(nthcdr index all-items))
;; Verify once again the structure, without ORDERED.
(org-list-struct-fix-box struct parents prevs nil)