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

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

Re: `save-excursion' defeated by `set-buffer'


From: Stefan Monnier
Subject: Re: `save-excursion' defeated by `set-buffer'
Date: Tue, 15 Mar 2011 13:46:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> Actually, there is a lot of reason to suppose that the author 
>> did *not* intend it: although the author most likely knew it
>> also did such a save-point-and-mark, she most likely used
>> save-excursion as a special-form that provides a super-set of
>> what she needed.  That's the case for the enormous majority
>> of save-excursion+set-buffer.

> Even if that were true for some very old code, there is no reason to bring
> `set-buffer' into it.

Of course there is: what I wrote is only true when set-buffer is used.
When it's not used in the save-excursion, then it's actually very common
for that save-excursion to indeed be used to save point (I have the
strong feeling that saving the mark is  complete waste for 99% of
save-excursions, but I haven't yet attacked this so I don't actually
know for sure).


        Stefan


reply via email to

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