GNU Info

Info Node: (emacs-lisp-intro.info)save-excursion

(emacs-lisp-intro.info)save-excursion


Next: Review Prev: Truth & Falsehood Up: Writing Defuns
Enter node , (file) or (file)node

`save-excursion'
================

   The `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 `save-excursion'
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.

Point and mark
A review of various locations.
Template for save-excursion

automatically generated by info2www version 1.2.2.9