[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65209: 30.0.50; Unexpected behaviour of setq-local
From: |
Eli Zaretskii |
Subject: |
bug#65209: 30.0.50; Unexpected behaviour of setq-local |
Date: |
Wed, 23 Aug 2023 14:39:46 +0300 |
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: 65209@debbugs.gnu.org, gerd.moellmann@gmail.com,
> monnier@iro.umontreal.ca
> Date: Wed, 23 Aug 2023 05:47:18 +0200
>
> Ok - I'm not good at writing documentation. As a start, do you think
> that it's possible to create a good addition to the manual out of this
> stub?
>
>
> | The following example demonstrates which binding is "seen" when
> | let-binding and buffer-local variables are combined:
> |
> | (defvar var :default)
> |
> | (with-temp-buffer
> | (let ((var :let-bound))
> | var ; --> :let-bound
> | (setq-local var :buffer-local)
> | var ; --> :buffer-local
> | (with-temp-buffer var)) ; --> :let-bound
> | var ; --> :buffer-local
> | (with-temp-buffer var)) ; --> :default
> |
> |
> | A lexical variable always refers to its lexical binding even when
> | a buffer-local variable of the same name exists:
> |
> | (let ((lvar :lexical))
> | (setq-local lvar :local)
> | lvar ; --> :lexical
> | (symbol-value 'lvar)) ; --> :local
Yes, but it has to be described in English, not (only) in Lisp.
(TBH, the first one is almost self-evident, and I find nothing
surprising or unexpected in it.)
> I would not suggest such an addition if I would not have missed that
> kind of information in the manual.
Which part(s) did you miss? AFAIU, the behavior with dynamic
variables is described in very clear terms which make the first
example completely described.
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, (continued)
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Stefan Monnier, 2023/08/13
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Stefan Monnier, 2023/08/13
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/13
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Gerd Möllmann, 2023/08/14
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Stefan Monnier, 2023/08/18
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/20
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Eli Zaretskii, 2023/08/20
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/21
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Eli Zaretskii, 2023/08/22
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/22
- bug#65209: 30.0.50; Unexpected behaviour of setq-local,
Eli Zaretskii <=
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Stefan Monnier, 2023/08/23
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/23
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Eli Zaretskii, 2023/08/24
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/25
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Eli Zaretskii, 2023/08/26
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Stefan Monnier, 2023/08/26
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/27
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Michael Heerdegen, 2023/08/23
- bug#65209: 30.0.50; Unexpected behaviour of setq-local, Eli Zaretskii, 2023/08/24