Subject: bug#16882: 24.3.50; with-temp-buffer-window broken

From: martin rudalics <[email-masked]>
Date: Fri, 28 Feb 2014 11:59:24 +0100

> Just a note on this: (Sorry to insist)
 >
 > You expect here the code of 'body' returns a stream like prin* function
 > family does, but IMHO 'body' should be any code that is self
 > contained in the "temp-buffer-window" and not elsewhere.
 > IOW the actual version is not safe in this sens because it may affect
 > the current-buffer.
 > I suspect already existing code is affected by this new behavior.
 >
 > Try:
 >
 > (with-temp-buffer-window "foo" nil nil (princ "hello"))
 >
 > and now
 >
 > (with-temp-buffer-window "foo" nil nil (insert "hello"))
 >
 > I expect here "hello" to be inserted in "foo" buffer, but actually it
 > corrupt current-buffer.

As the bug found by Juanma shows I was fooled by this myself.  It should
now behave again in your sense.  I still have to explain the behavior in
the manual.

Thanks, martin