Subject: bug#12532: 24.2.50; wrong results using byte-compile-file with lexical-binding

From: Stefan Monnier <[email-masked]>
Date: Fri, 28 Sep 2012 16:22:48 -0400

tags 12532 notabug
thanks

> On trunk Emacs compiling function with argument names declared as
> special somewhere, like mode-name, resulting function produced by
> byte-compile-file is different from function obtained by evaluating
> definition or byte-compiling that definition in buffer. This code uses
> all three possibilities and reports evaluating results

Yes.  Using special variables as function arguments is not supported for
lexical-binding code.  So the behavior can change according to the phase
of the moon.  That's also why the byte-compiler warns you that

test12592_hY.el:2:1:Warning: Argument *myvar* is not a lexical variable

        Stefan