Re: [PATCH] org-list.el: Reduce scope to subtree

2023-10-05 Thread Jeremias Gonzalez
On Thu, Oct 5, 2023 at 2:39 AM Ihor Radchenko  wrote:

> Thanks for providing the reproducer!
> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=88ff6c2fb


Wonderful, thank you! Looking at your patch it is definitely much more
involved than I was anticipating. Thank you very much for your hard work.


Re: [PATCH] org-list.el: Reduce scope to subtree

2023-10-05 Thread Ihor Radchenko
"J. G."  writes:

> When the relevant headline has that property set, is recurring, and is marked 
> as done, the headline and its subtrees (without my patch as I've now learned) 
> have their checkboxes and counter cookies correctly reset. However, top level 
> headlines elsewhere have their counter cookies incorrectly reset to [0/0].
> I have attached an example org file which contains a subheading "The
> heading to mark done to reproduce the problem" that when set to done
> will demonstrate this problem. I see the top level headings "Test
> heading 2" and "Test heading 3" have their counter cookies set to
> [0/0] which is not the desired behavior.

Thanks for providing the reproducer!
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=88ff6c2fb

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] org-list.el: Reduce scope to subtree

2023-09-26 Thread J. G.
 Good catch, thanks for the feedback.
The original problem I was attempting to correct was when making use of 
org-contrib's org-checklist.el feature to reset checkboxes with the 
RESET_CHECK_BOXES property. The earliest report of this bug I'm aware of is 
here: https://github.com/doomemacs/doomemacs/issues/1503
When the relevant headline has that property set, is recurring, and is marked 
as done, the headline and its subtrees (without my patch as I've now learned) 
have their checkboxes and counter cookies correctly reset. However, top level 
headlines elsewhere have their counter cookies incorrectly reset to [0/0].
I have attached an example org file which contains a subheading "The heading to 
mark done to reproduce the problem" that when set to done will demonstrate this 
problem. I see the top level headings "Test heading 2" and "Test heading 3" 
have their counter cookies set to [0/0] which is not the desired behavior.
On Tuesday, September 26, 2023 at 02:33:52 AM PDT, Ihor Radchenko 
 wrote:  
 
 "J. G."  writes:

> Hi, this patch reduces the scope of the function 
> org-reset-checkbox-state-subtree to just the subtree per its name and 
> documentation.
> ...
> -    (org-update-checkbox-count-maybe 'all)
> +    (org-update-checkbox-count-maybe)

Thanks for the patch, but without 'all argument,
`org-update-checkbox-count-may' will limit the scope to current
_heading_, not subtree.

May you please describe in more details the problem you experience?
Ideally with a reproducer. See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 
  * My top level heading to hold [1/3]
** TODO Another test heading
** DONE Yet another test heading
CLOSED: [2023-09-26 Tue 07:30]
** TODO The heading to mark done to reproduce the problem [3/3]
SCHEDULED: <2023-09-24 Sun ++1w>
:PROPERTIES:
:RESET_CHECK_BOXES: t
:END:
- [X] An extra box
- [X] Another extra box
- [X] Final extra box
*** DONE My first set [5/5]
CLOSED: [2023-09-26 Tue 07:06]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
*** DONE My second set [5/5]
CLOSED: [2023-09-26 Tue 07:06]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
*** DONE My third set [5/5]
CLOSED: [2023-09-26 Tue 06:49]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
* Test heading 2 [1/3]
:PROPERTIES:
:RESET_CHECK_BOXES: t
:END:
** TODO My first set 2 [3/5]
- [ ] My stuff
- [X] More stuff
- [ ] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
** TODO My second set 2 [3/5]
- [X] My stuff
- [X] More stuff
- [ ] Even more stuff
- [X] Lots of stuff
- [ ] Final stuff
** DONE My third set 2 [5/5]
CLOSED: [2023-09-26 Tue 06:49]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
* Test heading 3 [2/3]
:PROPERTIES:
:RESET_CHECK_BOXES: t
:END:
** TODO My first set 2 [4/5]
- [X] My stuff
- [X] More stuff
- [ ] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
** DONE My second set 2 [5/5]
CLOSED: [2023-09-26 Tue 07:10]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff
** DONE My third set 2 [5/5]
CLOSED: [2023-09-26 Tue 06:49]
- [X] My stuff
- [X] More stuff
- [X] Even more stuff
- [X] Lots of stuff
- [X] Final stuff


Re: [PATCH] org-list.el: Reduce scope to subtree

2023-09-26 Thread Ihor Radchenko
"J. G."  writes:

> Hi, this patch reduces the scope of the function 
> org-reset-checkbox-state-subtree to just the subtree per its name and 
> documentation.
> ...
> - (org-update-checkbox-count-maybe 'all)
> + (org-update-checkbox-count-maybe)

Thanks for the patch, but without 'all argument,
`org-update-checkbox-count-may' will limit the scope to current
_heading_, not subtree.

May you please describe in more details the problem you experience?
Ideally with a reproducer. See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] org-list.el: Reduce scope to subtree

2023-09-24 Thread J. G.
Hi, this patch reduces the scope of the function 
org-reset-checkbox-state-subtree to just the subtree per its name and 
documentation.From f7b0e67935f7677fe2c238a17bf4f70ac962ab08 Mon Sep 17 00:00:00 2001
From: JG 
Date: Sun, 24 Sep 2023 16:17:45 -0700
Subject: [PATCH] org-list.el: Reduce scope to subtree

* lisp/org-list.el (org-reset-checkbox-state-subtree): Fix
scope of function call to update checkboxes to just subtree.
TINYCHANGE
---
 lisp/org-list.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 7da10649d..023cfc0f8 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2523,7 +2523,7 @@ subtree, ignoring planning line and any drawer following it."
 	(when (org-at-item-checkbox-p)
 	  (replace-match "[ ]" t t nil 1))
 	(forward-line 1)))
-	(org-update-checkbox-count-maybe 'all)
+	(org-update-checkbox-count-maybe)
 
 (defun org-update-checkbox-count ( all)
   "Update the checkbox statistics in the current section.
-- 
2.40.1