GNU bug report logs - #12367
24.2.50; cl-defun: unused key args are picked up as unused variables

Previous Next

Package: emacs;

Reported by: Christopher Schmidt <christopher <at> ch.ristopher.com>

Date: Thu, 6 Sep 2012 12:20:02 UTC

Severity: minor

Found in version 24.2.50

Done: Christopher Schmidt <christopher <at> ch.ristopher.com>

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 12367 in the body.
You can then email your comments to 12367 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#12367; Package emacs. (Thu, 06 Sep 2012 12:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Schmidt <christopher <at> ch.ristopher.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Sep 2012 12:20:03 GMT) Full text and rfc822 format available.

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

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.50; cl-defun: unused key args are picked up as unused variables
Date: Thu,  6 Sep 2012 13:10:05 +0100 (BST)
severity: minor

    ;; -*- lexical-binding: t -*-

    (require 'cl-lib)
    (cl-defun rms (&key foo))

Byte compile this piece of code.

    Warning: Unused lexical variable `foo'

GNU Emacs 24.2.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of
2012-09-06.

        Christopher




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12367; Package emacs. (Thu, 06 Sep 2012 14:19:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12367: 24.2.50;
	cl-defun: unused key args are picked up as unused variables
Date: Thu, 06 Sep 2012 10:18:14 -0400
>     ;; -*- lexical-binding: t -*-
>     (require 'cl-lib)
>     (cl-defun rms (&key foo))
> Byte compile this piece of code.
>     Warning: Unused lexical variable `foo'

The warning is fine.  But I guess the problem is that the normal fix
(which is to rename `foo' to `_foo') won't work because it forces
callers to use :_foo which is wrong.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12367; Package emacs. (Thu, 06 Sep 2012 15:37:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12367: 24.2.50;
	cl-defun: unused key args are picked up as unused variables
Date: Thu, 06 Sep 2012 11:35:42 -0400
>     ;; -*- lexical-binding: t -*-
>     (require 'cl-lib)
>     (cl-defun rms (&key foo))

I've installed a patch on trunk so that you can use

   (cl-defun rms (&key _foo))

instead.


        Stefan




bug closed, send any further explanations to 12367 <at> debbugs.gnu.org and Christopher Schmidt <christopher <at> ch.ristopher.com> Request was from Christopher Schmidt <christopher <at> ch.ristopher.com> to control <at> debbugs.gnu.org. (Wed, 29 May 2013 14: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. (Thu, 27 Jun 2013 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 356 days ago.

Previous Next


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