From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Alan Mackenzie <acm@muc.de>
Cc: bug-gnu-emacs@gnu.org
Subject: bug#4608: Description of `buffer-swap-text' is vague and inadequate.
Date: Thu, 01 Oct 2009 09:56:00 -0400 [thread overview]
Message-ID: <jwvzl8b6x7z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20091001094854.GB4599@muc.de> (Alan Mackenzie's message of "Thu, 1 Oct 2009 09:48:54 +0000")
> 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
next prev parent reply other threads:[~2009-10-01 13:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 9:48 bug#4605: Description of `buffer-swap-text' is vague and inadequate Alan Mackenzie
2009-10-01 13:56 ` Stefan Monnier [this message]
2009-10-01 14:46 ` bug#4608: " Juanma Barranquero
2009-10-02 14:15 ` bug#4617: " Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvzl8b6x7z.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=4608@emacsbugs.donarmstrong.com \
--cc=acm@muc.de \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.