From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4655: 23.1.50; buffer-swap-text oddity Date: Wed, 07 Oct 2009 01:41:40 -0400 Message-ID: References: <20091006184604.9A5B2EFE6F@sonic02.math.uni-bielefeld.de> Reply-To: Stefan Monnier , 4655@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254894474 13227 80.91.229.12 (7 Oct 2009 05:47:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Oct 2009 05:47:54 +0000 (UTC) Cc: Markus Rost , 4655@emacsbugs.donarmstrong.com To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 07 07:47:44 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MvPNI-0002da-7n for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2009 07:47:44 +0200 Original-Received: from localhost ([127.0.0.1]:45084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvPNH-0000sX-O5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2009 01:47:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvPMr-0000ir-BI for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 01:47:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvPMm-0000hx-9b for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 01:47:17 -0400 Original-Received: from [199.232.76.173] (port=45564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvPMm-0000hm-4L for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 01:47:12 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35870) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvPMl-0006D1-K3 for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 01:47:11 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n975l9M2002188; Tue, 6 Oct 2009 22:47:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n975j7XS001737; Tue, 6 Oct 2009 22:45:07 -0700 Resent-Date: Tue, 6 Oct 2009 22:45:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 07 Oct 2009 05:45:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4655 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4655-submit@emacsbugs.donarmstrong.com id=B4655.12548941081331 (code B ref 4655); Wed, 07 Oct 2009 05:45:07 +0000 Original-Received: (at 4655) by emacsbugs.donarmstrong.com; 7 Oct 2009 05:41:48 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n975fkT2001328 for <4655@emacsbugs.donarmstrong.com>; Tue, 6 Oct 2009 22:41:48 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMFAMrGy0pMCqug/2dsb2JhbACBUdMKhCoEhzQ X-IronPort-AV: E=Sophos;i="4.44,517,1249272000"; d="scan'208";a="47219911" Original-Received: from 76-10-171-160.dsl.teksavvy.com (HELO ceviche.home) ([76.10.171.160]) by ironport2-out.pppoe.ca with ESMTP; 07 Oct 2009 01:41:40 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id B6A2FB4190; Wed, 7 Oct 2009 01:41:40 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Wed, 7 Oct 2009 06:01:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 07 Oct 2009 01:47:16 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31752 Archived-At: > Why do you expect buffer-swap-text to switch the current buffer? I'm not sure he expects it. And if he does, I can't tell you why, so I'll pass. > And, why it is doing it? I don't think it does when not called within save-excursion. But when called within the save-excursion, the reason is simple: 1- markers are swapped along with the buffer texts (with a some exceptions, mostly window-markers). 2- save-excursion saves the "position and current buffer" as a marker. Combine 1 and 2 together, and you'll see that save-excursion ends up changing the current buffer. Stefan