Programming in Emacs Lisp
save-excursion function is the fourth and final special form
that we will discuss in this chapter.
In Emacs Lisp programs used for editing, the
function is very common. It saves the location of point and mark,
executes the body of the function, and then restores point and mark to
their previous positions if their locations were changed. Its primary
purpose is to keep the user from being surprised and disturbed by
unexpected movement of point or mark.