Subject: Re: bug#58864: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el

From: Eli Zaretskii <[email-masked]>
Date: Sun, 30 Oct 2022 10:05:14 +0200

> Date: Sun, 30 Oct 2022 07:26:34 +0000 (UTC)
> From: Jaft <[email-masked]>
> Cc: "[email-masked]" <[email-masked]>
> 
> I'm not sure why this warning occurs? Can you not have unused arguments (marked as unused) in lexical
> scope?

You can, but the argument should indeed be marked as unused, by
prepending the '_' to its name.  Basil already did that, so the
problem is now solved.

> hierarchy--create-delayed-tree-widget calls widget-convert to create tree-widgets but, in the case of delayed
> children, provides an :expander to load when the child is called for; the :expander expects a function that can
> take a single argument: the widget you're making children for.
> I assume it's so your function can figure out what the children should be, depending on what the parent
> widget is.
> 
> However, Hierarchy already computes the children with the childrenfn a user can pass in so the parent widget
> is entirely unnecessary for us; so I marked is as unused by prefacing the variable name with an underscore,
> as I thought was the convention.

This explanation should be best put in a comment to that function, I
think.