From 9bb87f49f72de1ff7fcddc063f961d898b9f3c81 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 11 Aug 2015 14:11:15 +0200 Subject: [PATCH] org-list: Fix "Invalid search bound" error * lisp/org-list.el (org-update-checkbox-count): Fix "Invalid search bound" error. Reported-by: Rasmus --- lisp/org-list.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 05f19228e..e6a78f76e 100644 --- a/lisp/org-list.el +++ b/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