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

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

bug#5971: 23.1.95; `delete' modifies default value instead of buffer-loc


From: Drew Adams
Subject: bug#5971: 23.1.95; `delete' modifies default value instead of buffer-local value
Date: Wed, 21 Apr 2010 04:58:17 -0700

> > Before closing the bug, please consider adding something to 
> > the doc that might make this gotcha clearer. Perhaps something
> > like this:
> > 
> > Although `make-variable-buffer-local' makes its argument 
> > variable become buffer local whenever it is set, any
> > references to the variable before it is set return
> > its default value. That includes any occurrences of the 
> > variable in an expression used to calculate the new,
> > buffer-local value.
> 
> That is implied by the fact that make-variable-buffer-local 
> is a function (vs. macro vs. special form): its argument
> forms are evaluated before being passed to the function by eval.

Yeah, I know. And I shoulda known better. I didn't pay attention to the fact
that I had a defvar that set the default value to a cons cell - originally it
was nil (as it is again now). Still, it might help if we said something more
(admittedly different from what I suggested), to help users avoid such problems
destructively modifying the default value.








reply via email to

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