[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14486: 24.3.50; A very subtle/obscure bug - with-temp-buffer + pop-t
From: |
Stefan Monnier |
Subject: |
bug#14486: 24.3.50; A very subtle/obscure bug - with-temp-buffer + pop-to-buffer + insert |
Date: |
Tue, 28 May 2013 00:53:18 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> (defvar count 1)
> (defun testing ()
> (interactive)
> (forward-line 1)
> (insert (with-temp-buffer
> (insert (format "string-%d\n" (setq count (+ 1 count))))
> (pop-to-buffer (current-buffer))
> (buffer-string))))
When the outer `insert' is executed, the selected window is not the one
displaying *scratch* but the one displaying *Messages*, so the window's
point is not affected by `insert'.
You're just seeing the effect of the fact that each buffer has N+1
different `point's, where N is the number of windows displaying this buffer.
Stefan