emacs-devel
[Top][All Lists]
Advanced

[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: Tue, 20 Aug 2013 01:47:21 -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 should "fix"?

It means that the function uses an argument whose name refers to
a dynamically-scoped variable.  This is not allowed in lexically-scoped
code, so you need to rename either the dynbind var or the
function's argument.

>    Note that `emerge-exit-func' is a `defvar'ed variable. Should it be
>    replaced with something like this:

>    #+BEGIN_SRC emacs-lisp
>      (defun emerge-remote-exit (file-out exit-func)
>        (let ((emerge-exit-func exit-func))
>          (emerge-write-and-delete file-out)
>          (kill-buffer emerge-merge-buffer)
>          (funcall emerge-exit-func (if emerge-prefix-argument 1 0))))
>    #+END_SRC

Yes.

>  - In `emerge-revisions-with-ancestor', the variable `cmd' is let-bound,
>    but does not appear to be used.  Could it be safely removed?

Depends on the rest of the code.  Usually, if there's no assignment
or reference to a free variable named "cmd" elsewhere, there's a good
chance that such variables that are "let-bound but not used locally" are
indeed just unused and can be removed.


        Stefan



reply via email to

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