bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#14926: 24.3.50; Warning "`make-variable-buffer-local' should be call


From: Michael Heerdegen
Subject: bug#14926: 24.3.50; Warning "`make-variable-buffer-local' should be called at toplevel"
Date: Sat, 17 Aug 2013 01:02:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Glenn Morris <address@hidden> writes:

> This feature is 8 years old, BTW.
>
> So "Is this something new?" in Jul 2013 tells you something about how
> much of an issue this has been in practice.

I'll tell you something funny.  When Stefan said that 99% of
non-top-level uses of `make-variable-buffer-local' were wrong, I
searched my large .emacs for counter-examples.  I found 4 such places,
and for every place, it was by mistake!  Of course I knew the difference
when I wrote that code, but these function names sound so similar...

All these occurrences were wrapped inside something like

  (add-hook 'hook (lambda () ... (make-variable-buffer-local ...)))

or inside `with-eval-after-load' (that also wraps the body inside a
lambda) and no warning had been printed all the time.

It would be good to warn also for calls inside lambdas.


Michael.





reply via email to

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