From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#55900: [PATCH] Hierarchy =?UTF-8?Q?=E2=80=93?= Defer the Computation of Children Date: Thu, 28 Jul 2022 11:48:45 +0300 Message-ID: <83a68taahe.fsf@gnu.org> References: <83wndny5i7.fsf@gnu.org> <87mtei1cii.fsf@outlook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5039"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55900@debbugs.gnu.org To: Jaft Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 28 11:23:43 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGzk6-00018q-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 11:23:42 +0200 Original-Received: from localhost ([::1]:53176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGzk5-0003wj-EH for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jul 2022 05:23:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGzCg-0001LI-VX for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 04:49:12 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGzCY-0004uf-BU for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 04:49:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGzCY-0005cI-6x for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2022 04:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jul 2022 08:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55900 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55900-submit@debbugs.gnu.org id=B55900.165899812721567 (code B ref 55900); Thu, 28 Jul 2022 08:49:02 +0000 Original-Received: (at 55900) by debbugs.gnu.org; 28 Jul 2022 08:48:47 +0000 Original-Received: from localhost ([127.0.0.1]:57555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGzCI-0005bm-QA for submit@debbugs.gnu.org; Thu, 28 Jul 2022 04:48:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGzCG-0005bY-Da for 55900@debbugs.gnu.org; Thu, 28 Jul 2022 04:48:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGzCA-0004r4-TC; Thu, 28 Jul 2022 04:48:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=kDp5qWj9o9ymKNCcWmcDxLC7F43prniS+FsT0NCLjvA=; b=ROH+ev4kASBk3+5zC8Md l0M/7tRTrJNNk/Gz55SWzqCUJ3zRKTA89pVbyqgghuLnnNMFbEnYZ24GPZguo6YfrplR9I7yOl55+ tXM3p6jkooFEYBx6FSl6r+FHJHFCK7kBAhW/7umB67BKh86Zcte9xTqgRObO0Wr2PVst3B9vHqN3k KxSi4nfE+LLrr3NFbHXlb3BpOsVpAK3yXK1XUhdQUNEqcIplANehPo6xdypng3dSWg3e6KxfMVv6f 6x7WDJwrat24wG/bdn2Z8WW7CVyBq18vEABgAXGFKH/RJAQMab8elZl7VHOfWwSbKGA+qHF5ZeDLL 7hbB2uPADrZKYw==; Original-Received: from [87.69.77.57] (port=1782 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGzC9-0003S0-En; Thu, 28 Jul 2022 04:48:38 -0400 In-Reply-To: (message from Jaft on Sun, 12 Jun 2022 09:07:37 +0000 (UTC)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238085 Archived-At: > Date: Sun, 12 Jun 2022 09:07:37 +0000 (UTC) > From: Jaft > Cc: "55900@debbugs.gnu.org" <55900@debbugs.gnu.org> > > Hmm; I tried to attach the patch with Gnus but it doesn't look like it actually added it…. Sending again, via the browser this time. Thanks. Please see the few minor comments below. > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1756,6 +1756,15 @@ Enabling this minor mode turns on hiding header material, like > If non-nil, files untracked by a VCS are considered to be part of > the project by a VC project based on that VCS. > > +** Hierarchy > + > ++++ > +*** Tree Display can delay computation of children > +'hierarchy-add-tree' and 'hierarchy-add-trees' have an optional > +argument, 'delay-children-p', which allows storing 'childrenfn' to the > +nodes of a tree-widget display to be activated and computed only when > +the users expands the node. The first line (the heading) should end in a dot '.' The description itself is OK, but it sounds too detailed for NEWS. I'd suggest to make it shorter by dropping the reference to the optional argument's name and the "storing" part. It should be enough to say "which allows tree-widget display to be activated and computed only when the user expands the node". > (declare-function widget-convert "wid-edit") > +(defun hierarchy--create-delayed-tree-widget (elem labelfn indent childrenfn) > + "Return a list of tree-widgets for the children generated by calling > +CHILDRENFN on ELEM. The first line of a doc string should be a complete sentence. This is an internal function, so you could make the first sentence be less detailed. > --- a/test/lisp/emacs-lisp/hierarchy-tests.el > +++ b/test/lisp/emacs-lisp/hierarchy-tests.el > @@ -552,5 +552,146 @@ > (hierarchy-sort organisms) > (should (equal (hierarchy-roots organisms) '(animal plant))))) > > +(defun hierarchy-examples-delayed--find-number (num) > + "Find a number, NUM, by adding 1s together until you reach it. > +This is entire contrived and mostly meant to be purposefully inefficient to > +not be possible on a large scale. > +Running the number 200 causes this function to crash; running this function in > +`hierarchy-add-tree' with a root of 80 and no delayed children causes that to > + crash." Can you explain better what is the purpose of this function in the context of the tests which use it?