Browse Source

Fix `org-list-insert-item-generic' when checkboxes are updated

* org-list.el (org-list-insert-item-generic): Updating checkboxes can
  modifiy bottom point of a list, so make it a marker before calling
  `org-update-checkbox-count-maybe'.
Nicolas Goaziou 14 years ago
parent
commit
7e8aec9c09
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lisp/org-list.el

+ 3 - 0
lisp/org-list.el

@@ -669,6 +669,9 @@ function ends."
 	      ;; recompute next-item: last sexp modified list
 	      (goto-char (org-get-next-item (point) bottom))
 	      (org-move-to-column col)))
+	    ;; checkbox update might modify bottom point, so use a
+	    ;; marker here
+	    (setq bottom (copy-marker bottom))
 	    (when checkbox (org-update-checkbox-count-maybe))
 	    (org-list-repair nil top bottom))))
     (goto-char true-pos)