branch: externals/org
commit 84f9d81abceb8e260892bd8bd132b2e0a399e9c4
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-update-checkbox-count: Do not move point beyond current heading
    
    * lisp/org-list.el (org-update-checkbox-count): Do not move point
    before current heading when point is already on heading.
    
    Reported-by: Bruno Cardoso <cardoso...@gmail.com>
    Link: https://orgmode.org/list/878qz49an7....@gmail.com
---
 lisp/org-list.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 45a07a7154..564bc31bc1 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -106,6 +106,7 @@
 
 (declare-function org-at-heading-p "org" (&optional invisible-ok))
 (declare-function org-back-to-heading "org" (&optional invisible-ok))
+(declare-function org-back-to-heading-or-point-min "org" (&optional 
invisible-ok))
 (declare-function org-before-first-heading-p "org" ())
 (declare-function org-current-level "org" ())
 (declare-function org-element-at-point "org-element" (&optional pom 
cached-only))
@@ -2582,7 +2583,7 @@ portion of the buffer."
         ;; Move to start.
         (cond (all (goto-char (point-min)))
              (within-inlinetask (org-back-to-heading t))
-             (t (org-with-limited-levels (outline-previous-heading))))
+             (t (org-with-limited-levels (org-back-to-heading-or-point-min 
t))))
         ;; Build an alist for each cookie found.  The key is the position
         ;; at beginning of cookie and values ending position, format of
         ;; cookie, number of checked boxes to report and total number of

Reply via email to