unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9469: buffer-local variables seem to remember previous values
@ 2011-09-10 17:07 Le Wang
  2011-09-10 17:44 ` Drew Adams
  0 siblings, 1 reply; 24+ messages in thread
From: Le Wang @ 2011-09-10 17:07 UTC (permalink / raw)
  To: 9469

I've reproed in both Emacs 23.3 and bzr build from a few days ago both
on windows.

Steps:

1. emacs -Q

2. eval this region:

(setq buf-a (create-file-buffer "a"))

(setq foo nil)
(make-variable-buffer-local 'foo)

(defun test1 ()
  (interactive)
  (let (alist)
    (push '(:var . 0) alist)
    (with-current-buffer buf-a
      (setq foo alist))))

(defun test2 ()
  (interactive)
  (with-current-buffer buf-a
    (setcdr (assq :var foo) 20)))

(defun show ()
  (interactive)
  (with-current-buffer buf-a
    (format "    ; foo in 'a' is %s" foo)))

(defun test3 ()
  (interactive)
  (let (alist)
    (push `(:var . ,(+ 0)) alist)
    (with-current-buffer buf-a
      (setq foo alist))))


(test1)
(test2)
(test1)
(insert (show))
(test3)
(insert (show))

Note results on both `insert' lines should be identical but the first
insert some how remembers a previous value.  I find it surprising that
no one has ever come across this before.

-- 
Le





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

end of thread, other threads:[~2011-09-15 18:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-10 17:07 bug#9469: buffer-local variables seem to remember previous values Le Wang
2011-09-10 17:44 ` Drew Adams
2011-09-11 16:57   ` Le Wang
2011-09-11 17:56     ` Drew Adams
2011-09-11 18:08       ` Andreas Schwab
2011-09-11 18:49         ` Le Wang
2011-09-11 18:54           ` Lars Magne Ingebrigtsen
2011-09-11 19:18             ` Le Wang
2011-09-11 19:54               ` Lars Magne Ingebrigtsen
2011-09-12  4:39                 ` Le Wang
2011-09-12  7:57                   ` Andreas Schwab
2011-09-12  8:23                     ` Le Wang
2011-09-12  8:35                       ` Andreas Schwab
2011-09-12 14:30                         ` Drew Adams
2011-09-12 15:06                         ` Le Wang
2011-09-13 12:54                   ` Stefan Monnier
2011-09-13 13:12                     ` Le Wang
2011-09-13 15:00                     ` Helmut Eller
2011-09-13 18:02                     ` Johan Bockgård
2011-09-13 18:52                       ` Drew Adams
2011-09-13 20:42                         ` Helmut Eller
2011-09-15 18:14                       ` Le Wang
2011-09-11 19:37             ` Helmut Eller
2011-09-11 19:46           ` Andreas Schwab

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).