unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jaft <jaft.r@outlook.com>
Cc: 55900@debbugs.gnu.org
Subject: bug#55900: [PATCH] Hierarchy – Defer the Computation of Children
Date: Thu, 28 Jul 2022 11:48:45 +0300	[thread overview]
Message-ID: <83a68taahe.fsf@gnu.org> (raw)
In-Reply-To: <BY5PR07MB7029124F544ED185C030AA7D99A89@BY5PR07MB7029.namprd07.prod.outlook.com> (message from Jaft on Sun, 12 Jun 2022 09:07:37 +0000 (UTC))

> Date: Sun, 12 Jun 2022 09:07:37 +0000 (UTC)
> From: Jaft <jaft.r@outlook.com>
> 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?





  reply	other threads:[~2022-07-28  8:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11  6:52 bug#55900: [PATCH] Hierarchy – Defer the Computation of Children Wamm K. D.
2022-06-11  8:21 ` Eli Zaretskii
2022-06-12  9:01   ` Wamm K. D.
     [not found]   ` <87mtei1cii.fsf@outlook.com>
2022-06-12  9:07     ` Jaft
2022-07-28  8:48       ` Eli Zaretskii [this message]
     [not found]     ` <1383718586.2581914.1655024858024@mail.yahoo.com>
2022-07-27 12:36       ` Jaft
2022-07-28  8:52         ` Eli Zaretskii
2022-08-04  0:20           ` Jaft
2022-08-04  6:12             ` Eli Zaretskii
2022-10-27 16:13               ` Jaft
2022-10-27 17:17                 ` Eli Zaretskii
2022-10-27 19:14                   ` Jaft
2022-10-28  7:36                     ` Eli Zaretskii
2022-10-28  7:52                       ` Jaft
2022-10-28  7:56                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a68taahe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=55900@debbugs.gnu.org \
    --cc=jaft.r@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).