GNU bug report logs - #4655
23.1.50; buffer-swap-text oddity

Previous Next

Package: emacs;

Reported by: Markus Rost <rost <at> math.uni-bielefeld.de>

Date: Tue, 6 Oct 2009 18:55:07 UTC

Severity: minor

Tags: patch

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 4655 <at> debbugs.gnu.org, Markus Rost <rost <at> math.uni-bielefeld.de>
Subject: Re: bug#4655: 23.1.50; buffer-swap-text oddity
Date: Wed, 07 Oct 2009 01:41:40 -0400
> 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



This bug report was last modified 9 years and 28 days ago.

Previous Next


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