diff options
| author | Xue Fuqiao | 2015-08-24 22:04:46 +0800 |
|---|---|---|
| committer | Xue Fuqiao | 2015-08-24 22:04:46 +0800 |
| commit | 7741988982ea5de8dea80702a510505bb153c86a (patch) | |
| tree | 4440a2ad708ddf031f231fdbaf2dcb07c9295912 | |
| parent | 7eab29d251b893d5b7f87f1801706a86043fa428 (diff) | |
| download | emacs-7741988982ea5de8dea80702a510505bb153c86a.tar.gz emacs-7741988982ea5de8dea80702a510505bb153c86a.zip | |
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.
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/positions.texi | 3 | ||||
| -rw-r--r-- | lisp/mouse.el | 2 |
3 files changed, 7 insertions, 7 deletions
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 | |||
| 3227 | @smallexample | 3227 | @smallexample |
| 3228 | @group | 3228 | @group |
| 3229 | multiply-by-seven is a Lisp function. | 3229 | multiply-by-seven is a Lisp function. |
| 3230 | |||
| 3230 | (multiply-by-seven NUMBER) | 3231 | (multiply-by-seven NUMBER) |
| 3231 | 3232 | ||
| 3232 | Multiply NUMBER by seven. | 3233 | Multiply NUMBER by seven. |
| @@ -4152,8 +4153,8 @@ On the other hand, this function returns @code{nil} if the test is false. | |||
| 4152 | @section @code{save-excursion} | 4153 | @section @code{save-excursion} |
| 4153 | @findex save-excursion | 4154 | @findex save-excursion |
| 4154 | @cindex Region, what it is | 4155 | @cindex Region, what it is |
| 4155 | @cindex Preserving point, mark, and buffer | 4156 | @cindex Preserving point and buffer |
| 4156 | @cindex Point, mark, buffer preservation | 4157 | @cindex Point and buffer preservation |
| 4157 | @findex point | 4158 | @findex point |
| 4158 | @findex mark | 4159 | @findex mark |
| 4159 | 4160 | ||
| @@ -4202,7 +4203,7 @@ region}. Numerous commands work on the region, including | |||
| 4202 | @code{center-region}, @code{count-lines-region}, @code{kill-region}, and | 4203 | @code{center-region}, @code{count-lines-region}, @code{kill-region}, and |
| 4203 | @code{print-region}. | 4204 | @code{print-region}. |
| 4204 | 4205 | ||
| 4205 | The @code{save-excursion} special form saves the locations of point and | 4206 | The @code{save-excursion} special form saves the location of point and |
| 4206 | restores this position after the code within the body of the | 4207 | restores this position after the code within the body of the |
| 4207 | special form is evaluated by the Lisp interpreter. Thus, if point were | 4208 | special form is evaluated by the Lisp interpreter. Thus, if point were |
| 4208 | in the beginning of a piece of text and some code moved point to the end | 4209 | 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 | |||
| 4250 | as the value of the @code{save-excursion} function. The other | 4251 | as the value of the @code{save-excursion} function. The other |
| 4251 | expressions in the body are evaluated only for their side effects; and | 4252 | expressions in the body are evaluated only for their side effects; and |
| 4252 | @code{save-excursion} itself is used only for its side effect (which | 4253 | @code{save-excursion} itself is used only for its side effect (which |
| 4253 | is restoring the positions of point and mark). | 4254 | is restoring the position of point). |
| 4254 | 4255 | ||
| 4255 | @need 1250 | 4256 | @need 1250 |
| 4256 | In more detail, the template for a @code{save-excursion} expression | 4257 | 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 | |||
| 843 | Configurations} and in @ref{Frame Configurations}. @c frameset? | 843 | Configurations} and in @ref{Frame Configurations}. @c frameset? |
| 844 | 844 | ||
| 845 | @defspec save-excursion body@dots{} | 845 | @defspec save-excursion body@dots{} |
| 846 | @cindex mark excursion | ||
| 847 | @cindex point excursion | 846 | @cindex point excursion |
| 848 | This special form saves the identity of the current buffer and the | 847 | This special form saves the identity of the current buffer and the |
| 849 | value of point in it, evaluates @var{body}, and finally | 848 | value of point in it, evaluates @var{body}, and finally |
| 850 | restores the buffer and its saved value of point. both saved values are | 849 | restores the buffer and its saved value of point. Both saved values are |
| 851 | restored even in case of an abnormal exit via | 850 | restored even in case of an abnormal exit via |
| 852 | @code{throw} or error (@pxref{Nonlocal Exits}). | 851 | @code{throw} or error (@pxref{Nonlocal Exits}). |
| 853 | 852 | ||
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." | |||
| 1027 | (interactive "e") | 1027 | (interactive "e") |
| 1028 | (mouse-minibuffer-check click) | 1028 | (mouse-minibuffer-check click) |
| 1029 | (select-window (posn-window (event-start click))) | 1029 | (select-window (posn-window (event-start click))) |
| 1030 | ;; We don't use save-excursion because that preserves the mark too. | 1030 | ;; FIXME: Use save-excursion |
| 1031 | (let ((point-save (point))) | 1031 | (let ((point-save (point))) |
| 1032 | (unwind-protect | 1032 | (unwind-protect |
| 1033 | (progn (mouse-set-point click) | 1033 | (progn (mouse-set-point click) |