Browse Source

org-list: Fix "Invalid search bound" error

* lisp/org-list.el (org-update-checkbox-count): Fix "Invalid search
  bound" error.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/99837>
Nicolas Goaziou 9 years ago
parent
commit
9bb87f49f7
1 changed files with 7 additions and 4 deletions
  1. 7 4
      lisp/org-list.el

+ 7 - 4
lisp/org-list.el

@@ -2550,10 +2550,13 @@ With optional prefix argument ALL, do this for the whole buffer."
 			   (when (eq (org-element-type element) 'item)
 			     (push (org-element-property :structure element)
 				   structs)
-			     (goto-char (org-element-property
-					 :end
-					 (org-element-property :parent
-							       element))))))
+			     ;; Skip whole list since we have its
+			     ;; structure anyway.
+			     (while (setq element (org-element-lineage
+						   element '(plain-list)))
+			       (goto-char
+				(min (org-element-property :end element)
+				     end))))))
 		       ;; Cache count for cookies applying to the same
 		       ;; area.  Then return it.
 		       (let ((count