GNU bug report logs - #5371
Priority of different kind of local variable bindings

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Wed, 13 Jan 2010 09:21:02 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 5371 <at> debbugs.gnu.org
Subject: bug#5371: Priority of different kind of local variable bindings
Date: Wed, 13 Jan 2010 13:45:47 -0500
>> What do you mean by "priority of different kind of local variables"?
> I just meant which value is active at a certain point.

It's not based on priorities.

> (with-temp-buffer
>   (set (make-local-variable 'temp-var) "buffer-2")
>   (temp-var-display "cc")

>   (let ((temp-var "let"))
>     (temp-var-display "dd")

>     (kill-local-variable 'temp-var)
>     (temp-var-display "ff"))

The `let' binding affects the currently "active" slot, so in this case
it affects the buffer-local slot.  So after kill-local-variable, this
binding is lost.

Note that mixing let-binding and buffer-local bindings is generally
discouraged.  The only known reasonably sane semantics for such a mix is
when the variable is always buffer-local.  If you mix `let' with
make-local-variable and kill-local-variable you're really asking
for trouble.


        Stefan




This bug report was last modified 15 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.