summaryrefslogtreecommitdiff
path: root/lispref/positions.texi
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-10-03 01:56:15 +0000
committerMiles Bader <miles@gnu.org>2000-10-03 01:56:15 +0000
commita6d81c937bd2a0f2ebdfeeed413764b106338c02 (patch)
treedc8c2261296d974cf1bb3c7aba65feb1eba7d4c6 /lispref/positions.texi
parent96f71a4964c3963a36be0fef120590b985ec7267 (diff)
downloademacs-a6d81c937bd2a0f2ebdfeeed413764b106338c02.tar.gz
(Narrowing): Get rid of warning about now-fixed save-restriction bug.
Diffstat (limited to 'lispref/positions.texi')
-rw-r--r--lispref/positions.texi25
1 files changed, 1 insertions, 24 deletions
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 7ae412ffe5a..378134e30c2 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000
@c Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../info/positions
@@ -911,29 +911,6 @@ restored with temporary narrowing still in effect. If the old point
value were outside the limits of the temporary narrowing, this would
fail to restore it accurately.
-The @code{save-restriction} special form records the values of the
-beginning and end of the accessible portion as distances from the
-beginning and end of the buffer. In other words, it records the amount
-of inaccessible text before and after the accessible portion.
-
-This method yields correct results if @var{body} does further narrowing.
-However, @code{save-restriction} can become confused if the body widens
-and then makes changes outside the range of the saved narrowing. When
-this is what you want to do, @code{save-restriction} is not the right
-tool for the job. Here is what you must use instead:
-
-@example
-@group
-(let ((beg (point-min-marker))
- (end (point-max-marker)))
- (unwind-protect
- (progn @var{body})
- (save-excursion
- (set-buffer (marker-buffer beg))
- (narrow-to-region beg end))))
-@end group
-@end example
-
Here is a simple example of correct use of @code{save-restriction}:
@example