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

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

bug#65209: 30.0.50; Unexpected behaviour of setq-local


From: Michael Heerdegen
Subject: bug#65209: 30.0.50; Unexpected behaviour of setq-local
Date: Sat, 26 Aug 2023 04:09:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

> Please describe such situations, where the escape (i.e. how to avoid
> bumping into this subtlety, by either rewriting the code or using
> auxiliary variables) is not clear.

I don't know.  The problem is that when setting buffer-local variables
it is unknown which bindings are in effect unless you explicitly look.

Recently there was a question, I tried to find it again but failed,
where a user wanted to set, or expected a variable to be set - was it
`lexical-binding'? - and that failed because there was a binding of
`lexical-binding' in the call chain that prevented this.  Too bad I
don't find it anymore, it was not long ago.  Maybe the example has even
been fixed now, but maybe it was also the case that Stefan mention, that
case where the right semantics were not trivial.

Anyway, I mean potentially any operation where a new buffer is created
and set up, and any bindings of variables that may be made buffer local
are also bound when creating a buffer.  Dunno, like, creating a new
dired buffer from dired, and you need to bind the same variable to
create the buffer that you also want to make buffer local.

I don't know whether something like this can happen at all.  Stefan's
examples use `setq', not `setq-local', so maybe everything is just fine
after his fix of this bug.  I can't tell for sure because I can't read C
very efficiently and we don't have doc describing this, so I am not
really a good person to ask.  Since Stefan is quiet, let's assume the
situation is good enough now.


Michael.





reply via email to

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