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#4608: Description of `buffer-swap-text' is vague and inadequate. Date: Thu, 01 Oct 2009 09:56:00 -0400 Message-ID: References: <20091001094854.GB4599@muc.de> Reply-To: Stefan Monnier , 4608@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 1254406132 7909 80.91.229.12 (1 Oct 2009 14:08:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2009 14:08:52 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 01 16:08:45 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 1MtMKf-0005Vw-Ei for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 16:08:33 +0200 Original-Received: from localhost ([127.0.0.1]:51522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtMKe-0006w8-Uz for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Oct 2009 10:08:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtMJP-0006Em-4N for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 10:07:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtMJL-0006A2-0x for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 10:07:14 -0400 Original-Received: from [199.232.76.173] (port=56848 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtMJK-00069f-Ge for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 10:07:10 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45273) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtMJJ-0007oq-SC for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 10:07:10 -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 n91E77dn005307; Thu, 1 Oct 2009 07:07:07 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n91E56wk004423; Thu, 1 Oct 2009 07:05:06 -0700 Resent-Date: Thu, 1 Oct 2009 07:05:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 01 Oct 2009 14:05:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4608 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12544053743223 (code B ref -1); Thu, 01 Oct 2009 14:05:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 1 Oct 2009 13:56:14 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n91DuCWW003220 for ; Thu, 1 Oct 2009 06:56:13 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtM8g-0001R2-IQ for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 09:56:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtM8Y-0001OS-TV for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 09:56:07 -0400 Original-Received: from [199.232.76.173] (port=58941 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtM8Y-0001OK-7W for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 09:56:02 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:32756 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtM8Y-0005Yz-3B for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2009 09:56:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJNRxEpMCrXH/2dsb2JhbACBUdUyhCkEhxo X-IronPort-AV: E=Sophos;i="4.44,487,1249272000"; d="scan'208";a="46898690" Original-Received: from 76-10-181-199.dsl.teksavvy.com (HELO ceviche.home) ([76.10.181.199]) by ironport2-out.pppoe.ca with ESMTP; 01 Oct 2009 09:56:00 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 94723B4265; Thu, 1 Oct 2009 09:56:00 -0400 (EDT) In-Reply-To: <20091001094854.GB4599@muc.de> (Alan Mackenzie's message of "Thu, 1 Oct 2009 09:48:54 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 01 Oct 2009 10:07:14 -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:31615 Archived-At: > The Elisp manual page "Swapping Text", says that `buffer-swap-text' > "swaps text between the current buffer and its argument BUFFER." > This tells me nothing. I'd have to read the source (or maybe try it > out) to find out what this function does. > What does "swap" mean here? How much text is "swapped". What does > "between" mean? > A naive guess would suggest this command takes a bit of text out of > buffer A and dumps it into buffer B, simultaneously moving a bit of B > into A. No, it swaps the whole freakin' text, including text-properties, markers, and overlays. So at the end, buffer A has buffer B's text and vice versa. > There is also no entry in .../src/ChangeLog (or ChangeLog.10, ...) > marking the introduction of this command. grep disagrees: % grep buffer.swap.text src/ChangeLog* src/ChangeLog: * buffer.c (Fbuffer_swap_text): Use POINTER_TYPE. src/ChangeLog: * buffer.c (Fbuffer_swap_text) [REL_ALLOC]: Reset ralloc's internal src/ChangeLog: * buffer.c (Fbuffer_swap_text): Signal error if swapping a dead buffer. src/ChangeLog: * buffer.c (Fbuffer_swap_text): Remove redundant marker manipulation. src/ChangeLog: * buffer.c (Fbuffer_swap_text): Reset window->point markers. src/ChangeLog: * buffer.c (Fbuffer_swap_text): New function. % -- Stefan