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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
	A very subtle/obscure bug - with-temp-buffer + pop-to-buffer + insert
Date: Tue, 28 May 2013 08:16:41 +0530
A very subtle/obscure bug.  I have a hard time explaining the observed
behaviour.

1. emacs -Q
2. In the scratch buffer copy the following snippet and install it.

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

3. M->

4. M-x testing
   C-x o

   M-x testing
   C-x o

   M-x testing
   C-x o

5. Expected behaviour: Point should be at the END of the scratch buffer

Observed behaviour: Not as expected.


Now comment out the `pop-to-buffer' in the snippet above, install the
changes and repeat.  You will see that the point is at END of the
scratch buffer.






In GNU Emacs 24.3.50.3 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-05-27 on debian-6.05
Bzr revision: 112737 monnier <at> iro.umontreal.ca-20130527010843-s4qzq34vq5x532aj
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t




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.