Next: , Previous: , Up: How To Write Function Definitions   [Contents][Index]

3.10 save-excursion

The save-excursion function is the 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, executes the body of the function, and then restores point to its previous position if its location was changed. Its primary purpose is to keep the user from being surprised and disturbed by unexpected movement of point.