emacs-devel
[Top][All Lists]
Advanced

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

Re: Why is not end-of-defun-function buffer local?


From: Stefan Monnier
Subject: Re: Why is not end-of-defun-function buffer local?
Date: Mon, 10 Dec 2007 00:13:02 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>> More specifically, the problem is to decide *when* to make a variable
>> buffer-local.  I.e. Setting the variable via `setq' should make it
>> buffer-local, but setting it with `let' shouldn't.

> Has this to be carved in stone?  Why should with

> (defvar foo 1)
> (make-variable-buffer-local 'foo)

> the form below not set the default value of foo

> (let ((foo 2))
>   (setq-default foo 3))

> and the following form

> (progn
>   (setq foo 4)
>   (let ((foo 2))      
>     (setq-default foo 3)))

> set it?  Isn't code depending on one or the other behavior silly anyway?

Yes, the interaction between buffer-local bindings and let bindings
is messy.  There is no generally right answer, AFAICT.  So we just
developped some heuristic over time about what the semantics should look
like, so as to work OK in most cases.
The "automatically local when set" is of course making it yet
a bit messier.  Not sure what we should do about that.


        Stefan




reply via email to

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