[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings in cc mode
From: |
Stefan Monnier |
Subject: |
Re: Warnings in cc mode |
Date: |
Tue, 15 Nov 2005 19:06:11 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> What is so bad about calling `make-variable-buffer-local' from a function
> rather than top level? Or even, for that matter, calling it from an
> `eval-after-load' form?
make-variable-buffer-local changes the behavior of a variable globally and
for ever. So it's a property of the variable and should only ever appear
right next to the corresponding defvar.
Many people incorrectly use make-variable-buffer-local where they meant
make-local-variable, and this warning catches this (that's the reason why
I added the warning).
Just like for all warnings, there are corner cases where the warning is
triggered in a situation where the code is actually really doing what it
intends to do.
Stefan