Re: warnings in methods with enabled lexical-binding

Sergey <[email protected]> Tue, 21 May 2013 15:30:45 +0500
Newsgroups gmane.emacs.eieio
Message-ID <op.wxfjhjjd3bbi7f@sergeek-desktop>
On Tue, 07 May 2013 05:27:56 +0500, Eric M. Ludlam  wrote:

> On 04/14/2013 11:41 AM, Sergey Petrov wrote:
>> Hello, I receive following warning during any (e.g. from quick start
>> section in manual) method evaluation:
>> Warning: Unused lexical variable `scoped-class'
>> Does eieio works with lexical binding correctly?
>
> Hi Sergey,
>
> Sorry for the slow response.
>
> The scoped-class feature in EIEIO would indeed break lexical binding.  
> I'm not that familiar with lexical binding, or how to 'fix' EIEIO to  
> work with it.
>
> I'm open to suggestions to how to fix it from the list.
>
> Eric


Thank you. I just wanted a peaceful co-existence for my lexical closures  
with eieio classes and methods in the same .el file.
Probably, the following patch will solve this 'problem'.

*** eieio.el	2013-05-21 11:20:04.133759895 +0500
*** 1235,1241 ****
       ;; is faster to execute this for not byte-compiled.  ie, install  
this,
       ;; then measure calls going through here.  I wonder why.
       (require 'bytecomp)
!   (let ((byte-compile-warnings nil))
         (byte-compile
          `(lambda (&rest local-args)
     	,doc-string
--- 1235,1242 ----
       ;; is faster to execute this for not byte-compiled.  ie, install  
this,
       ;; then measure calls going through here.  I wonder why.
       (require 'bytecomp)
!   (let ((byte-compile-warnings nil)
! 	  (lexical-binding nil))
         (byte-compile
          `(lambda (&rest local-args)
     	,doc-string


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may