Browse Source

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.
Nicolas Goaziou 5 years ago
parent
commit
f67370f6ea
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-list.el

+ 3 - 1
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)