[Top][All Lists]

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

Re: save-excursion again

From: Stephen J. Turnbull
Subject: Re: save-excursion again
Date: Sun, 20 Jun 2010 02:23:56 +0900

Lennart Borgman writes:

 > > What is wrong with just saving the point in the buffer you are
 > > interested and then returning to that, i.e.
 > (let ((here (point)))
 >    ...
 >    (prog1
 >         return_value
 >      (goto-char here)))

No protection against abnormal exits or changes to the mark.  The
more important issue is abnormal exits, eg, if a search fails, since
code shouldn't mess with the mark anyway.

Which brings up a question for Stefan.  Are you saying that the
condition-case-save-point-and-mark aspect of `save-excursion' should
be abstracted out (say as `save-region') and separated from the
save-buffer aspect?

reply via email to

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