Fix documentation for `save-excursion'

* doc/lispref/positions.texi (Excursions):
* doc/lispintro/emacs-lisp-intro.texi (save-excursion)
(Template for save-excursion, Point and mark): `save-excursion'
does not save&restore the mark any more.
This commit is contained in:
Xue Fuqiao 2015-08-24 22:04:46 +08:00
parent 7eab29d251
commit 7741988982
3 changed files with 7 additions and 7 deletions

View file

@ -3227,6 +3227,7 @@ function, @code{multiply-by-seven}. When you do this, a
@smallexample
@group
multiply-by-seven is a Lisp function.
(multiply-by-seven NUMBER)
Multiply NUMBER by seven.
@ -4152,8 +4153,8 @@ On the other hand, this function returns @code{nil} if the test is false.
@section @code{save-excursion}
@findex save-excursion
@cindex Region, what it is
@cindex Preserving point, mark, and buffer
@cindex Point, mark, buffer preservation
@cindex Preserving point and buffer
@cindex Point and buffer preservation
@findex point
@findex mark
@ -4202,7 +4203,7 @@ region}. Numerous commands work on the region, including
@code{center-region}, @code{count-lines-region}, @code{kill-region}, and
@code{print-region}.
The @code{save-excursion} special form saves the locations of point and
The @code{save-excursion} special form saves the location of point and
restores this position after the code within the body of the
special form is evaluated by the Lisp interpreter. Thus, if point were
in the beginning of a piece of text and some code moved point to the end
@ -4250,7 +4251,7 @@ one expression in the body, the value of the last one will be returned
as the value of the @code{save-excursion} function. The other
expressions in the body are evaluated only for their side effects; and
@code{save-excursion} itself is used only for its side effect (which
is restoring the positions of point and mark).
is restoring the position of point).
@need 1250
In more detail, the template for a @code{save-excursion} expression

View file

@ -843,11 +843,10 @@ window configurations, see the forms described in @ref{Window
Configurations} and in @ref{Frame Configurations}. @c frameset?
@defspec save-excursion body@dots{}
@cindex mark excursion
@cindex point excursion
This special form saves the identity of the current buffer and the
value of point in it, evaluates @var{body}, and finally
restores the buffer and its saved value of point. both saved values are
restores the buffer and its saved value of point. Both saved values are
restored even in case of an abnormal exit via
@code{throw} or error (@pxref{Nonlocal Exits}).

View file

@ -1027,7 +1027,7 @@ This must be bound to a mouse click."
(interactive "e")
(mouse-minibuffer-check click)
(select-window (posn-window (event-start click)))
;; We don't use save-excursion because that preserves the mark too.
;; FIXME: Use save-excursion
(let ((point-save (point)))
(unwind-protect
(progn (mouse-set-point click)