GNU bug report logs - #14486
24.3.50; A very subtle/obscure bug - with-temp-buffer + pop-to-buffer + insert

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Tue, 28 May 2013 02:49:02 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 14486 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 14486 <at> debbugs.gnu.org
Subject: Re: 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
>       (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




This bug report was last modified 11 years and 349 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.