unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40975: 28.0.50; Variable gets buffer-local unexpectedly
@ 2020-04-30  2:26 Michael Heerdegen
  2020-10-22 14:27 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Heerdegen @ 2020-04-30  2:26 UTC (permalink / raw)
  To: 40975


Hello,

here is a reproducer:

#+begin_src emacs-lisp
(defun test ()
  (make-local-variable 'my-test-var)
  (with-current-buffer (get-buffer-create "Testbuffer")
    (setq my-test-var 27)))
#+end_src

If you eval M-: (test) e.g. in emacs -Q and inspect the binding of
`my-test-var' in "Testbuffer" and the other buffers, you'll see that the
variable has become buffer local in "Testbuffer" though it has never
been made local there.  This is the bug.

Maybe there is a problem in this case because the `setq' setting is in
the same lexical scope as the `make-local-variable' call?

TIA,

Michael.



In GNU Emacs 28.0.50 (build 57, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, cairo version 1.16.0)
 of 2020-04-29 built on drachen
Repository revision: fe9be663833db1bf99f38c981378255f88ff5d06
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40975: 28.0.50; Variable gets buffer-local unexpectedly
  2020-04-30  2:26 bug#40975: 28.0.50; Variable gets buffer-local unexpectedly Michael Heerdegen
@ 2020-10-22 14:27 ` Lars Ingebrigtsen
  2020-10-23 18:07   ` Michael Heerdegen
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-22 14:27 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 40975

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello,
>
> here is a reproducer:
>
> #+begin_src emacs-lisp
> (defun test ()
>   (make-local-variable 'my-test-var)
>   (with-current-buffer (get-buffer-create "Testbuffer")
>     (setq my-test-var 27)))
> #+end_src
>
> If you eval M-: (test) e.g. in emacs -Q and inspect the binding of
> `my-test-var' in "Testbuffer" and the other buffers, you'll see that the
> variable has become buffer local in "Testbuffer" though it has never
> been made local there.  This is the bug.

I'm seeing the opposite -- my-test-var is local to whatever buffer I
said M-: (test) in (but is unbound there), and is bound and has the
value 27 in all other buffers.

Which is what I'd expect?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40975: 28.0.50; Variable gets buffer-local unexpectedly
  2020-10-22 14:27 ` Lars Ingebrigtsen
@ 2020-10-23 18:07   ` Michael Heerdegen
  2020-10-24 19:53     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Heerdegen @ 2020-10-23 18:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 40975

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Which is what I'd expect?

Hmm - indeed, I see the same as you.

I have no explanation.  Maybe I was just wrong, or it had been an
intermediate issue, or a dynamical vs. lexical binding mode thing.  I
guess you can just close.

Thanks,

Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40975: 28.0.50; Variable gets buffer-local unexpectedly
  2020-10-23 18:07   ` Michael Heerdegen
@ 2020-10-24 19:53     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-24 19:53 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 40975

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I have no explanation.  Maybe I was just wrong, or it had been an
> intermediate issue, or a dynamical vs. lexical binding mode thing.  I
> guess you can just close.

Perhaps you just checked in the test buffer and the original buffer and
saw that they were different, and then assumed that was because it was
local to the opposite buffer?  Or something?

Anyway, closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-24 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  2:26 bug#40975: 28.0.50; Variable gets buffer-local unexpectedly Michael Heerdegen
2020-10-22 14:27 ` Lars Ingebrigtsen
2020-10-23 18:07   ` Michael Heerdegen
2020-10-24 19:53     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).