GNU bug report logs - #58864
29.0.50; Warning when compiling emacs-lisp/hierarchy.el

Previous Next

Package: emacs;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Sat, 29 Oct 2022 12:00:01 UTC

Severity: normal

Tags: fixed

Found in version 29.0.50

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58864 in the body.
You can then email your comments to 58864 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58864; Package emacs. (Sat, 29 Oct 2022 12:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arash Esbati <arash <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 29 Oct 2022 12:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: emacs-bugs <bug-gnu-emacs <at> gnu.org>
Subject: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el
Date: Sat, 29 Oct 2022 13:58:45 +0200
Hi all,

building Emacs from master (f826f56a41) issues this warning:

  In hierarchy--create-delayed-tree-widget:
  emacs-lisp/hierarchy.el:570:12: Warning: Unused lexical argument `widget'

I'm not familiar with the code, but I think this is due to commit
c6ec08e49a and how `hierarchy--create-delayed-tree-widget' is defined.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58864; Package emacs. (Sat, 29 Oct 2022 12:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 58864 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Arash Esbati <arash <at> gnu.org>, Jaft <jaft.r <at> outlook.com>
Cc: 58864 <at> debbugs.gnu.org
Subject: Re: bug#58864: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el
Date: Sat, 29 Oct 2022 15:45:44 +0300
> From: Arash Esbati <arash <at> gnu.org>
> Date: Sat, 29 Oct 2022 13:58:45 +0200
> 
> building Emacs from master (f826f56a41) issues this warning:
> 
>   In hierarchy--create-delayed-tree-widget:
>   emacs-lisp/hierarchy.el:570:12: Warning: Unused lexical argument `widget'
> 
> I'm not familiar with the code, but I think this is due to commit
> c6ec08e49a and how `hierarchy--create-delayed-tree-widget' is defined.

Jonathan, could you please fix this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58864; Package emacs. (Sun, 30 Oct 2022 07:28:01 GMT) Full text and rfc822 format available.

Message #11 received at 58864 <at> debbugs.gnu.org (full text, mbox):

From: Jaft <jaft.r <at> outlook.com>
To: Arash Esbati <arash <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: "58864 <at> debbugs.gnu.org" <58864 <at> debbugs.gnu.org>
Subject: Re: bug#58864: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el
Date: Sun, 30 Oct 2022 07:26:34 +0000 (UTC)
[Message part 1 (text/plain, inline)]
 I'm not sure why this warning occurs? Can you not have unused arguments (marked as unused) in lexical scope?
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.
Is my understanding mistaken? Does it, say, have to only be an underscore for the argument rather than a name which starts with an underscore? I thought just starting with an underscore sufficed.    On Saturday, October 29, 2022 at 07:46:29 AM CDT, Eli Zaretskii <eliz <at> gnu.org> wrote:  
 
 > From: Arash Esbati <arash <at> gnu.org>
> Date: Sat, 29 Oct 2022 13:58:45 +0200
> 
> building Emacs from master (f826f56a41) issues this warning:
> 
>  In hierarchy--create-delayed-tree-widget:
>  emacs-lisp/hierarchy.el:570:12: Warning: Unused lexical argument `widget'
> 
> I'm not familiar with the code, but I think this is due to commit
> c6ec08e49a and how `hierarchy--create-delayed-tree-widget' is defined.

Jonathan, could you please fix this?
  
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58864; Package emacs. (Sun, 30 Oct 2022 08:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 58864 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jaft <jaft.r <at> outlook.com>
Cc: 58864 <at> debbugs.gnu.org, arash <at> gnu.org
Subject: Re: bug#58864: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el
Date: Sun, 30 Oct 2022 10:05:14 +0200
> Date: Sun, 30 Oct 2022 07:26:34 +0000 (UTC)
> From: Jaft <jaft.r <at> outlook.com>
> Cc: "58864 <at> debbugs.gnu.org" <58864 <at> debbugs.gnu.org>
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58864; Package emacs. (Sun, 30 Oct 2022 11:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 58864 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58864 <at> debbugs.gnu.org, Jaft <jaft.r <at> outlook.com>
Subject: Re: bug#58864: 29.0.50; Warning when compiling emacs-lisp/hierarchy.el
Date: Sun, 30 Oct 2022 12:42:53 +0100
tags 58864 fixed
close 58864
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

> 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.

Yes, the issue is gone.  Closing and thanks to Basil for the prompt
action.

Best, Arash




Added tag(s) fixed. Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 30 Oct 2022 11:44:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 58864 <at> debbugs.gnu.org and Arash Esbati <arash <at> gnu.org> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 30 Oct 2022 11:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Nov 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.