2 Oct 2009 16:15
bug#4617: Description of `buffer-swap-text' is vague and inadequate.
Alan Mackenzie <acm <at> muc.de>
2009-10-02 14:15:20 GMT
2009-10-02 14:15:20 GMT
Hi, Stefan, On Thu, Oct 01, 2009 at 09:56:00AM -0400, Stefan Monnier wrote: > > 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. Ah. OK, got you! I'll patch in a "the" sometime, to make it "swaps THE text between .....". But overlays? Overlays aren't part of the text (thought text-properties are). But this has probably been talked through anyway, some long time ago. Sounds like a brilliant idea, though - you could use this for several major modes in the same "buffer", somehow. > > There is also no entry in .../src/ChangeLog (or ChangeLog.10, ...) > > marking the introduction of this command. > grep disagrees: Apologies. I was grepping for "buffer-swap-text". > -- Stefan -- -- Alan Mackenzie (Nuremberg, Germany).
RSS Feed