eintr: Template for save-excursion
3.10.1 Template for a ‘save-excursion’ Expression
-------------------------------------------------
The template for code using ‘save-excursion’ is simple:
(save-excursion
BODY...)
The body of the function is one or more expressions that will be
evaluated in sequence by the Lisp interpreter. If there is more than
one expression in the body, the value of the last one will be returned
as the value of the ‘save-excursion’ function. The other expressions in
the body are evaluated only for their side effects; and ‘save-excursion’
itself is used only for its side effect (which is restoring the position
of point).
In more detail, the template for a ‘save-excursion’ expression looks
like this:
(save-excursion
FIRST-EXPRESSION-IN-BODY
SECOND-EXPRESSION-IN-BODY
THIRD-EXPRESSION-IN-BODY
...
LAST-EXPRESSION-IN-BODY)
An expression, of course, may be a symbol on its own or a list.
In Emacs Lisp code, a ‘save-excursion’ expression often occurs within
the body of a ‘let’ expression. It looks like this:
(let VARLIST
(save-excursion
BODY...))