[Top][All Lists]

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

Re: save-excursion again

From: Stefan Monnier
Subject: Re: save-excursion again
Date: Thu, 01 Jul 2010 02:30:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I think the point is that save-excursion has been saving too much.  So, when
> we see a save-excursion in a piece of code, we are not sure whether it was
> meant to save the point and mark, or the current-buffer, or both.  It seems
> that the original developers were themselves unsure after a while.

Yes, it's part of the tension between "DWIMish user commands" and
"simple&predictable Lisp functions", where save-excursion has a kind of
"DWIMish user-command" feeling to it (it does various things and you can
keep using that single form for various purposes).

> I took Stephen's point as saying that, if we have separate
> save-current-buffer and save-region, with save-excursion strongly
> discouraged, we would promote a clearer programming style.

Probably.  But then, for the same reasons, you'd also want to have
save-point since save-region is so rarely needed.


reply via email to

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