From: Xue Fuqiao Date: Mon, 24 Aug 2015 14:04:46 +0000 (+0800) Subject: Fix documentation for `save-excursion' X-Git-Tag: emacs-25.0.90~1267 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7741988982ea5de8dea80702a510505bb153c86a;p=emacs.git 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. --- diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 40abc442109..f4e8d936992 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -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 diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index c972bbb2e43..200935d5c60 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -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}). diff --git a/lisp/mouse.el b/lisp/mouse.el index 50482711006..f52b83b05c8 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -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)