GNU bug report logs - #4608
Description of `buffer-swap-text' is vague and inadequate.

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 1 Oct 2009 14:05:05 UTC

Severity: normal

Merged with 4605, 4617

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: Description of `buffer-swap-text' is vague and inadequate.
Date: Thu, 01 Oct 2009 09:56:00 -0400
> 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




This bug report was last modified 15 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.