From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 22:48:24 2013 Received: (at submit) by debbugs.gnu.org; 28 May 2013 02:48:24 +0000 Received: from localhost ([127.0.0.1]:36984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uh9xX-0003OD-Dp for submit@debbugs.gnu.org; Mon, 27 May 2013 22:48:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34896) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uh9xR-0003Ng-Dc for submit@debbugs.gnu.org; Mon, 27 May 2013 22:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uh9w2-0008GR-0z for submit@debbugs.gnu.org; Mon, 27 May 2013 22:46:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,T_DKIM_INVALID,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh9w1-0008GN-Tj for submit@debbugs.gnu.org; Mon, 27 May 2013 22:46:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh9vw-0002Ig-1v for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 22:46:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uh9vr-0008Fb-83 for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 22:46:43 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:57557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uh9vr-0008FU-0I for bug-gnu-emacs@gnu.org; Mon, 27 May 2013 22:46:39 -0400 Received: by mail-pd0-f173.google.com with SMTP id v14so5882069pde.32 for ; Mon, 27 May 2013 19:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=C2fhumF6MQbXrFa2NH9Z0+UUs8GpjktaJgKHwB+vh28=; b=eerNIRG07WsKLvK0JtLY1+1BbSYtjWvvAKX+VcN5PE1Jxyba8+Rl1dHxVVXJcs38Ca DUXJyXhuTBtOMh3b3+5OfbYLk6IhJ2F/9FutZqySIo/8N33ioHcEA+/2UgHN/4dZQdvn DHcRlHt4dw7ReC27DuCdc7qZQZqbrl28ppV0Yc5AYF7RpQ1Kuu4lmrWHb2kJ+e1/tPob 8oqw7xsfPRmvJvc+ONimG73BjYbz6/GN0IfaqzzopRQU0IDYtmwoHKXb1WTs2s0+UYOr s1cyxtSt3kQVM1GWJqJOvcBmMCKhnxqvGoi22y9nPdZj2ToSYO7i26N7Uy6FbeZgd+yr KOxQ== X-Received: by 10.66.230.199 with SMTP id ta7mr32931306pac.153.1369709197938; Mon, 27 May 2013 19:46:37 -0700 (PDT) Received: from debian-6.05 ([115.241.127.204]) by mx.google.com with ESMTPSA id qi1sm32977918pac.21.2013.05.27.19.46.35 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 19:46:37 -0700 (PDT) From: Jambunathan K To: bug-gnu-emacs@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 Message-ID: <878v2zn7n2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) 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@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 From debbugs-submit-bounces@debbugs.gnu.org Tue May 28 00:54:45 2013 Received: (at 14486) by debbugs.gnu.org; 28 May 2013 04:54:45 +0000 Received: from localhost ([127.0.0.1]:37043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UhBvp-0008Bx-4X for submit@debbugs.gnu.org; Tue, 28 May 2013 00:54:45 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:47782) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UhBvm-0008Be-EL for 14486@debbugs.gnu.org; Tue, 28 May 2013 00:54:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCpOt/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJLEfkA6RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFFMCpOt/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJLEfkA6RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="14784498" Received: from 76-10-147-173.dsl.teksavvy.com (HELO pastel.home) ([76.10.147.173]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 28 May 2013 00:53:15 -0400 Received: by pastel.home (Postfix, from userid 20848) id 5BAA967B0B; Tue, 28 May 2013 00:53:18 -0400 (EDT) From: Stefan Monnier To: Jambunathan K Subject: Re: bug#14486: 24.3.50; A very subtle/obscure bug - with-temp-buffer + pop-to-buffer + insert Message-ID: References: <878v2zn7n2.fsf@gmail.com> Date: Tue, 28 May 2013 00:53:18 -0400 In-Reply-To: <878v2zn7n2.fsf@gmail.com> (Jambunathan K.'s message of "Tue, 28 May 2013 08:16:41 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 14486 Cc: 14486@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > (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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 11 20:08:11 2013 Received: (at control) by debbugs.gnu.org; 12 Jun 2013 00:08:11 +0000 Received: from localhost ([127.0.0.1]:57419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UmYbi-0005Ho-UE for submit@debbugs.gnu.org; Tue, 11 Jun 2013 20:08:11 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:42595 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UmYbh-0005Hf-Kx for control@debbugs.gnu.org; Tue, 11 Jun 2013 20:08:10 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UmYbP-0003er-K9 for control@debbugs.gnu.org; Tue, 11 Jun 2013 20:07:51 -0400 Date: Tue, 11 Jun 2013 20:07:51 -0400 Message-Id: Subject: control message for bug 14486 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) tag 14486 notabug close 14486 From unknown Sat Jun 21 10:39:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 10 Jul 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator