NOTE: I changed the subject line to something more appropriate, also
getting rid of the approval of the patch for the previous problem to
avoid confusion.
Katsumi Yamaoka <yamaoka(a)jpl.org> wrote:
I found another problem which may also be related to the
byte-compiler. Please evaluate the following two programs in
the *scratch* buffer:
(progn
(with-temp-buffer
(funcall
(lambda nil
(make-variable-buffer-local 'foo-bar-baz-1)
(defvar foo-bar-baz-1 nil))))
foo-bar-baz-1)
(progn
(with-temp-buffer
(funcall
(byte-compile
(lambda nil
(make-variable-buffer-local 'foo-bar-baz-2)
(defvar foo-bar-baz-2 nil)))))
foo-bar-baz-2)
You will see the later does not bind the variable for all
buffers.
[snip edebug stuff]
This is not due to the byte compiler. Emacs produces (effectively)
identical byte code. What's different is that, when interpreted, the
defvar form does this:
if (NILP (Fdefault_boundp (sym)))
{
struct gcpro gcpro1;
GCPRO1 (val);
val = Feval (val);
Fset_default (sym, val);
UNGCPRO;
}
but when byte-compiled invokes a varset, which does this:
if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value))
symbol_ptr->value = new_value;
else
Fset (symbol, new_value);
But varset is used for setq too, isn't it? So I'm not sure how to
modify that to fix the problem you've noted without breaking other
stuff.
--
Jerry James
http://www.ittc.ku.edu/~james/