bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4655: 23.1.50; buffer-swap-text oddity


From: Stefan Monnier
Subject: bug#4655: 23.1.50; buffer-swap-text oddity
Date: Wed, 07 Oct 2009 01:41:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]