emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing argument in org-reset-checkbox-state-subtree?


From: Kyle Meyer
Subject: Re: Missing argument in org-reset-checkbox-state-subtree?
Date: Wed, 11 Nov 2020 22:22:22 -0500

Bob Wilson writes:

> I’m writing about a possible bug in
> org-reset-checkbox-state-subtree. This function calls
> org-update-checkbox-count-maybe with argument 'all, but this value is
> not defined in the function (or anywhere else that I can see).

[ I'm looking at the copy on master (e9c3993ee), though org-list.el
  hasn't changed since that last release. ]

org-reset-checkbox-state-subtree calls

    (org-update-checkbox-count-maybe 'all)

and org-update-checkbox-count-maybe calls

    (org-update-checkbox-count all)

And org-update-checkbox-count considers ALL, so I'm not spotting
anything that's undefined.

> I’d like this value to be nil because I don’t want to update the
> statistics cookies in the entire buffer, but I don’t see a way to do
> this (pardon my limited elisp). My workaround is to add an optional
> all argument to org-reset-checkbox-state-subtree and pass it to
> org-update-checkbox-count-maybe.

Why does refreshing the stats for the entire buffer cause a problem for
you?

> This seems like the desired functionality unless I’m missing
> something. Is the current implementation intentional?

Yes, the change was made with a0bc3bdeb (org-list: fix update of
check-boxes cookies in whole trees, 2011-06-20).  The example that
prompted that change was reported at
<https://orgmode.org/list/87fwn4bhcy.fsf@gmail.com/>.

Here's a reduced example:

  * a
  ** aa [1/1]
  - [X] l
  ** ab [1/1]
  - [X] m

Calling org-reset-checkbox-state-subtree with point at the top-level "a"
should uncheck l and m and the stats of both subheadings should go to
[0/1]:

  * a
  ** aa [0/1]
  - [ ] l
  ** ab [0/1]
  - [ ] m

If you were to drop `all' from -reset-checkbox-state-subtree's the call
to -update-checkbox-count-maybe, the result would instead be

  * a
  ** aa [1/1]
  - [ ] l
  ** ab [0/1]
  - [ ] m



reply via email to

[Prev in Thread] Current Thread [Next in Thread]