From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UyZsDf5y+2BTEwEAgWs5BA (envelope-from ) for ; Sat, 24 Jul 2021 03:55:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SNZRCP5y+2AXWgAAbx9fmQ (envelope-from ) for ; Sat, 24 Jul 2021 01:55:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B1C4219921 for ; Sat, 24 Jul 2021 03:55:09 +0200 (CEST) Received: from localhost ([::1]:59222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m76sd-0003eD-9o for larch@yhetil.org; Fri, 23 Jul 2021 21:55:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m76sF-0003dr-UO for emacs-orgmode@gnu.org; Fri, 23 Jul 2021 21:54:43 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:44023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m76sE-0003eY-Bt for emacs-orgmode@gnu.org; Fri, 23 Jul 2021 21:54:43 -0400 Received: by mail-pj1-x1034.google.com with SMTP id m2-20020a17090a71c2b0290175cf22899cso6129149pjs.2 for ; Fri, 23 Jul 2021 18:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=3AwnwIhl4oKg22mMqk5YMsI9KEYNvl3RmbSyf3RBpVo=; b=QBQX+NJ6gadobFQDMYq+ZFOWnCXAMYIb8xrKb6hp4sT6Itteu/7cV+iy6K5WnS49Dq ZuFPhlMevFWllAJu8Grj0rBNbo1tH84tDPS6TQmJ3KJRuamkazo8ziwOpLUhzIh32N0v 39oLlLzZ8IjSqvLWBG8d4yvzxs5TJAbtWxnPZYTnZ1xkGk0XmwO73O2C0ut2LoUZ44Rf Kt2X0bC5TgN6GGzb3MwOAO/eJ98mI0NZfjPAxPX/4Ww76GqWP9+cpdsGALCEbG2tPfmR zxAF1JGKZgO10Kfomr8MmZ8VOeIIbdRzbsYGGsq8niE4DyGZg8iffWuSyUICNBQvSQH+ fSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=3AwnwIhl4oKg22mMqk5YMsI9KEYNvl3RmbSyf3RBpVo=; b=Xoyj9Ynqls1WYWCB0ljWfZ8SubW2nUHwruEMfUuCMtkns9PbR8KjyOUgxu6sMP0UqU DRGh+OM2IWMLI4wxZzTOY7EsuU9KA837h1Zq3uoyZKYNBhRJlkDOm2oaiRDwUnrpQ5JZ lD2SrzSzDeJjhq5DO/MXwzw25gZYTqD8yeSNla0H7L8z3fYGID3I/LbR6HMhsFUcNSNE CN7Dj7FD39bCbXfrWtSyDa59pOl+qB/XSISh8Ch+6It/R2ud2MNVC78fTBll5RUn9soh DHnCylX2RMzPQKF4uK18B7qBcyRqILIzueRlqnVI+ZPhUrftkHhChHSr65oqWJtXWYTJ VeYw== X-Gm-Message-State: AOAM533tNUQFi+Vs9CPSI+UG1DlUDgjKmTXtnfVFpt5V5mYQVCJJxwSL pnW1GzBDH0TeFml8LXcs8A6MFsthy08= X-Google-Smtp-Source: ABdhPJxiUCwnMoJumQhz8R2f16AZ9PC/1egoGJMDOrXBMQwoN+gOvsS/zvI/Xaj99TZGFdR+BHScBg== X-Received: by 2002:a17:90a:d598:: with SMTP id v24mr6723634pju.185.1627091680756; Fri, 23 Jul 2021 18:54:40 -0700 (PDT) Received: from tim-desktop (106-69-82-1.dyn.iinet.net.au. [106.69.82.1]) by smtp.gmail.com with ESMTPSA id s25sm1269840pgv.87.2021.07.23.18.54.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 18:54:39 -0700 (PDT) References: User-agent: mu4e 1.5.14; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Cascading cookie counts Date: Sat, 24 Jul 2021 10:48:46 +1000 In-reply-to: Message-ID: <87sg04qxwj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627091709; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3AwnwIhl4oKg22mMqk5YMsI9KEYNvl3RmbSyf3RBpVo=; b=PIIUkJ8KmmtWz8mgI/5fr17iX8X9p9wSLv0ZcrZv48wzG6+4ATmENVoGwGb/IE2COR/uFQ dI0cRcDjeEBM++nIeCUyPuuDPjjKdPwqyOnC+qTTWg1S9BmKaxtUBbkuvj7whcm+AU7Cxq sNLlIYFKTPdVbAm5di6ygABCkWsS3AlvhxefmjbTy7T8LNn5rSrLgb+ACGHXjIqeOiri89 bHtlYFQEsdtZivS5Hi5o56khLAXYXxFLsiQqldBRIKOUexzItVVnbqm6Ljd8T06UW64tzl o6WjZd7hCYi3cDHSDuSCVspaNFB2FRjYSnJc8/jOSPMoeAHJFCp1MK9MhzSfAQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627091709; a=rsa-sha256; cv=none; b=SFXLqbjTqGuwRuWOGtMxLF2+0+UxJT3a3fxgO+NPKmdZOoiRHVQa94GS2cw9Fcn8U3oNyK w/F27wSihElE9rkzGl02lARsrXoWa/aiWz4FGeML0PzHC6zObOftgXdKj2hs2i2rlu+v+D skq5lVj/eMSyxlBh/7Eh2WAV3F7QWt/OCPs6xqBA9N7GkZd2whGXWbHwWYNiWZCopeQ8Mu 0JC2si7zmGpQ+zn7Fj+YFxLnY66yPsteifY4nHZOAj19d66Jg9PaRspafIeJ0kOAf0pTvB WnJw1nPys/cq/ydy/zBh4ySje4FpSYUmpFuYrQ/jBx2yuFpqclAxxyPpEib68Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QBQX+NJ6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QBQX+NJ6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B1C4219921 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: o+/hoZ0ArbHJ George Mauer writes: > * Cascading Checkbox Cookie Counts > I would like checkbox cookies to show the total of all cookies beneath them regardless of hierarchy nesting. > The code for ~org-update-checkbox-count~ is more complex than I expected so before spending time digging into this, maybe someone here has a > tip? > > ** This should show 3/5 [1/2] > - [X] Done > - [ ] Not Done > ** Nesting level 1 > - [ ] Not Done > - [X] Done > ** Nesting level 2 > *** Nesting level 2.1 > - [X] Done > > ** Cookie data recursive doesn't seem to affect this > My understanding is that there's a cookie data ~~ property flag you can use. I assumed that's what this was for but it seems to not > affect things (I've tried both with and without the angle braces, but the regex seems to imply braces which is odd) > *** This should show 3/5 [1/2] > :PROPERTIES: > :COOKIE_DATA: > :END: > - [X] Done > - [ ] Not Done > *** Nesting level 1 > - [ ] Not Done > - [X] Done > *** Nesting level 2 > **** Nesting level 2.1 > - [X] Done I think there may be some confusion regarding expected and actual behaviour. Possibly the manual could be clarified a bit. I did find one error in the manual where it refers to org-hierarchical-checkbox-statistics when the variable is actually called org-checkbox-hierarchical-statistics. I think it is actually the variable name in the code which is incorrect as there is a org-hierarchical-todo-statistics - seems somewhat inconsistent. Probably should rename the variable in the code to be org-hierarchical-checkbox-statistics to be consistent. Where I think there is confusion is that when the manual talks about the hierarchical structure, it is talking about the list item structure e.g. * This should show 1/2 [1/2] - [X] Item 1 - [-] Item 2 - [ ] Item 2.1 - [X] Item 2.2 - [X] Item 2.2.1 or * This should show 3/5 [2/5] :PROPERTIES: :COOKIE_DATA: recursive :END: - [X] Item 1 - [-] Item 2 - [ ] Item 2.1 - [-] Item 2.2 - [X] Item 2.2.1 if you want a checkbox hierarchy, they can be of different levels, but must all be within the same list environment. You cannot have checkboxes spread across different sub trees (heading levels) While I can see what you are after, I cannot see how the current implementation could be changed and not result in significant breakage for others. I also think the code is complex enough that if you also removed the restriction that the checkbox hierarchy has to be within the same heading, it would become even more complex and would likely result in significant performance impact as you would now need to search multiple heading hierarchies etc.