[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lexical byte-compilation warnings cleanup

From: Stefan Monnier
Subject: Re: Lexical byte-compilation warnings cleanup
Date: Wed, 04 Sep 2013 23:30:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>  - I'm seeing a lot of "Argument foo is not a lexical variable", such as
>    in vc/ediff-diff.el:532:56. What does this mean and is this something

I've noticed that there's a bug in byte-compile-force-lexical-warnings
which causes extra spurious warnings of this kind, so when using
byte-compile-force-lexical-warnings, double check those warnings (which
have been changed in the mean time to use a different formulation) since
they may just be spurious.

> -(defun dbus-string-to-byte-array (string)
> -  "Transforms STRING to list (:array :byte c1 :byte c2 ...).
> -STRING shall be UTF8 coded."
> -  (if (zerop (length string))
> +(defun dbus-string-to-byte-array (str)
> +  "Transforms STR to list (:array :byte c1 :byte c2 ...).
> +STR shall be UTF8 coded."
> +  (if (zerop (length str))

E.g. your renaming of a `string' argument to `str' is probably the
result of such a spurious warning.  So I didn't apply this hunk.

> -(defun eww-display-raw (charset)
> +(defun eww-display-raw (_charset)
>    (let ((data (buffer-substring (point) (point-max))))
>      (eww-setup-buffer)
>      (let ((inhibit-read-only t))

When unused function arguments can be removed (as is the case here),
it's generally a better choice than to mark them as unused.

I just installed your patch, thank you, and sorry for the delay,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]