aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-28 12:25:54 +0000
committerRichard M. Stallman1994-05-28 12:25:54 +0000
commit29679a81c7f1b4e231972c8f5034fa4de8957728 (patch)
treeaca3bc10b7b242793c83b84522e081777ef6ae9a /lispref
parentdb07847fc06e14e4f3ca1599d9c7f6612ffe81a5 (diff)
downloademacs-29679a81c7f1b4e231972c8f5034fa4de8957728.tar.gz
emacs-29679a81c7f1b4e231972c8f5034fa4de8957728.zip
*** empty log message ***
Diffstat (limited to 'lispref')
-rw-r--r--lispref/markers.texi33
-rw-r--r--lispref/positions.texi143
2 files changed, 95 insertions, 81 deletions
diff --git a/lispref/markers.texi b/lispref/markers.texi
index 1e7ceebe7df..ae2deeb9b4d 100644
--- a/lispref/markers.texi
+++ b/lispref/markers.texi
@@ -31,7 +31,7 @@ just as an integer could be used. @xref{Positions}, for a complete
31description of positions. 31description of positions.
32 32
33 A marker has two attributes: the marker position, and the marker 33 A marker has two attributes: the marker position, and the marker
34buffer. The marker position is an integer which is equivalent (at a 34buffer. The marker position is an integer that is equivalent (at a
35given time) to the marker as a position in that buffer. But the 35given time) to the marker as a position in that buffer. But the
36marker's position value can change often during the life of the marker. 36marker's position value can change often during the life of the marker.
37Insertion and deletion of text in the buffer relocate the marker. The 37Insertion and deletion of text in the buffer relocate the marker. The
@@ -141,7 +141,7 @@ accessible portion of the buffer, or to the same place as another given
141marker. 141marker.
142 142
143@defun make-marker 143@defun make-marker
144This functions returns a newly allocated marker that does not point 144This functions returns a newly created marker that does not point
145anywhere. 145anywhere.
146 146
147@example 147@example
@@ -309,10 +309,10 @@ in @var{buffer}. If @var{buffer} is not provided, it defaults to
309the current buffer. 309the current buffer.
310 310
311If @var{position} is less than 1, @code{set-marker} moves @var{marker} 311If @var{position} is less than 1, @code{set-marker} moves @var{marker}
312to the beginning of the buffer. If the value of @var{position} is 312to the beginning of the buffer. If @var{position} is greater than the
313greater than the size of the buffer, @code{set-marker} moves marker to 313size of the buffer, @code{set-marker} moves marker to the end of the
314the end of the buffer. If @var{position} is @code{nil} or a marker that 314buffer. If @var{position} is @code{nil} or a marker that points
315points nowhere, then @var{marker} is set to point nowhere. 315nowhere, then @var{marker} is set to point nowhere.
316 316
317The value returned is @var{marker}. 317The value returned is @var{marker}.
318 318
@@ -365,16 +365,15 @@ explicitly. @xref{Interactive Codes}.
365 Each buffer has its own value of the mark that is independent of the 365 Each buffer has its own value of the mark that is independent of the
366value of the mark in other buffers. When a buffer is created, the mark 366value of the mark in other buffers. When a buffer is created, the mark
367exists but does not point anywhere. We consider this state as ``the 367exists but does not point anywhere. We consider this state as ``the
368absence of a mark in that buffer''. 368absence of a mark in that buffer.''
369 369
370 Once the mark ``exists'' in a buffer, it normally never ceases to 370 Once the mark ``exists'' in a buffer, it normally never ceases to
371exist. However, it may become @dfn{inactive}, if Transient Mark mode is 371exist. However, it may become @dfn{inactive}, if Transient Mark mode is
372enabled. The variable @code{mark-active}, which is always local in all 372enabled. The variable @code{mark-active}, which is always local in all
373buffers, indicates whether the mark is active: non-@code{nil} means 373buffers, indicates whether the mark is active: non-@code{nil} means yes.
374yes. A command can request deactivation of the mark upon return to the 374A command can request deactivation of the mark upon return to the editor
375editor command loop by setting @code{deactivate-mark} to a 375command loop by setting @code{deactivate-mark} to a non-@code{nil} value
376non-@code{nil} value (but this deactivation only follows if Transient 376(but this causes deactivation only if Transient Mark mode is enabled).
377Mark mode is enabled).
378 377
379 The main motivation for using Transient Mark mode is that this mode 378 The main motivation for using Transient Mark mode is that this mode
380also enables highlighting of the region when the mark is active. 379also enables highlighting of the region when the mark is active.
@@ -399,7 +398,7 @@ this buffer.
399 398
400@defun mark-marker 399@defun mark-marker
401This function returns the current buffer's mark. This is the very marker 400This function returns the current buffer's mark. This is the very marker
402which records the mark location inside Emacs, not a copy. Therefore, 401that records the mark location inside Emacs, not a copy. Therefore,
403changing this marker's position will directly affect the position of the mark. 402changing this marker's position will directly affect the position of the mark.
404Don't do it unless that is the effect you want. 403Don't do it unless that is the effect you want.
405 404
@@ -505,9 +504,15 @@ inactive.
505 504
506@defvar deactivate-mark 505@defvar deactivate-mark
507If an editor command sets this variable non-@code{nil}, then the editor 506If an editor command sets this variable non-@code{nil}, then the editor
508command loop deactivates the mark after the command returns. 507command loop deactivates the mark after the command returns, but only if
508Transient Mark mode is enabled.
509@end defvar 509@end defvar
510 510
511@defun deactivate-mark
512This function deactivates the mark, but only if Transient Mark mode
513is enabled.
514@end defun
515
511@defvar mark-active 516@defvar mark-active
512The mark is active when this variable is non-@code{nil}. This variable 517The mark is active when this variable is non-@code{nil}. This variable
513is always local in each buffer. 518is always local in each buffer.
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 7d2c3ea40a6..b3f4bd17b42 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -7,15 +7,15 @@
7@chapter Positions 7@chapter Positions
8@cindex position (in buffer) 8@cindex position (in buffer)
9 9
10 A @dfn{position} is the index of a character in the text of buffer. 10 A @dfn{position} is the index of a character in the text of a buffer.
11More precisely, a position identifies the place between two characters 11More precisely, a position identifies the place between two characters
12(or before the first character, or after the last character), so we can 12(or before the first character, or after the last character), so we can
13speak of the character before or after a given position. However, the 13speak of the character before or after a given position. However, we
14we often speak of the character ``at'' a position, meaning the character 14often speak of the character ``at'' a position, meaning the character
15after that position. 15after that position.
16 16
17 Positions are usually represented as integers starting from 1, but can 17 Positions are usually represented as integers starting from 1, but can
18also be represented as @dfn{markers}---special objects which relocate 18also be represented as @dfn{markers}---special objects that relocate
19automatically when text is inserted or deleted so they stay with the 19automatically when text is inserted or deleted so they stay with the
20surrounding characters. @xref{Markers}. 20surrounding characters. @xref{Markers}.
21 21
@@ -58,7 +58,7 @@ details.
58 58
59@defun point 59@defun point
60@cindex current buffer position 60@cindex current buffer position
61 This function returns the position of point in the current buffer, 61This function returns the value of point in the current buffer,
62as an integer. 62as an integer.
63 63
64@need 700 64@need 700
@@ -71,26 +71,26 @@ as an integer.
71@end defun 71@end defun
72 72
73@defun point-min 73@defun point-min
74 This function returns the minimum accessible value of point in the 74This function returns the minimum accessible value of point in the
75current buffer. This is 1, unless narrowing is in effect, in 75current buffer. This is normally 1, but if narrowing is in effect, it
76which case it is the position of the start of the region that you 76is the position of the start of the region that you narrowed to.
77narrowed to. (@xref{Narrowing}.) 77(@xref{Narrowing}.)
78@end defun 78@end defun
79 79
80@defun point-max 80@defun point-max
81 This function returns the maximum accessible value of point in the 81This function returns the maximum accessible value of point in the
82current buffer. This is @code{(1+ (buffer-size))}, unless narrowing is 82current buffer. This is @code{(1+ (buffer-size))}, unless narrowing is
83in effect, in which case it is the position of the end of the region 83in effect, in which case it is the position of the end of the region
84that you narrowed to. (@xref{Narrowing}). 84that you narrowed to. (@xref{Narrowing}).
85@end defun 85@end defun
86 86
87@defun buffer-end flag 87@defun buffer-end flag
88 This function returns @code{(point-min)} if @var{flag} is less than 1, 88This function returns @code{(point-min)} if @var{flag} is less than 1,
89@code{(point-max)} otherwise. The argument @var{flag} must be a number. 89@code{(point-max)} otherwise. The argument @var{flag} must be a number.
90@end defun 90@end defun
91 91
92@defun buffer-size 92@defun buffer-size
93 This function returns the total number of characters in the current 93This function returns the total number of characters in the current
94buffer. In the absence of any narrowing (@pxref{Narrowing}), 94buffer. In the absence of any narrowing (@pxref{Narrowing}),
95@code{point-max} returns a value one larger than this. 95@code{point-max} returns a value one larger than this.
96 96
@@ -129,7 +129,7 @@ or relative to the edges of the selected window. @xref{Point}.
129@subsection Motion by Characters 129@subsection Motion by Characters
130 130
131 These functions move point based on a count of characters. 131 These functions move point based on a count of characters.
132@code{goto-char} is the fundamental primitive; the functions others use 132@code{goto-char} is the fundamental primitive; the other functions use
133that. 133that.
134 134
135@deffn Command goto-char position 135@deffn Command goto-char position
@@ -192,14 +192,14 @@ argument.
192@end deffn 192@end deffn
193 193
194@deffn Command backward-word count 194@deffn Command backward-word count
195This function just like @code{forward-word}, except that it moves 195This function is just like @code{forward-word}, except that it moves
196backward until encountering the front of a word, rather than forward. 196backward until encountering the front of a word, rather than forward.
197 197
198In an interactive call, @var{count} is set to the numeric prefix 198In an interactive call, @var{count} is set to the numeric prefix
199argument. 199argument.
200 200
201This function is rarely used in programs, as it is more efficient to 201This function is rarely used in programs, as it is more efficient to
202call @code{forward-word} with negative argument. 202call @code{forward-word} with a negative argument.
203@end deffn 203@end deffn
204 204
205@defvar words-include-escapes 205@defvar words-include-escapes
@@ -230,7 +230,7 @@ Likewise, to move to the end of the buffer, use:
230@end group 230@end group
231@end example 231@end example
232 232
233 Here are two commands which users use to do these things. They are 233 Here are two commands that users use to do these things. They are
234documented here to warn you not to use them in Lisp programs, because 234documented here to warn you not to use them in Lisp programs, because
235they set the mark and display messages in the echo area. 235they set the mark and display messages in the echo area.
236 236
@@ -250,7 +250,7 @@ Don't use this function in Lisp programs!
250This function moves point to the end of the buffer (or the limits of 250This function moves point to the end of the buffer (or the limits of
251the accessible portion, when narrowing is in effect), setting the mark 251the accessible portion, when narrowing is in effect), setting the mark
252at the previous position. If @var{n} is non-@code{nil}, then it puts 252at the previous position. If @var{n} is non-@code{nil}, then it puts
253point @var{n} tenths of the way from the end. 253point @var{n} tenths of the way from the end of the buffer.
254 254
255In an interactive call, @var{n} is the numeric prefix argument, 255In an interactive call, @var{n} is the numeric prefix argument,
256if provided; otherwise @var{n} defaults to @code{nil}. 256if provided; otherwise @var{n} defaults to @code{nil}.
@@ -272,10 +272,12 @@ control characters are displayed.
272 272
273@deffn Command goto-line line 273@deffn Command goto-line line
274This function moves point to the front of the @var{line}th line, 274This function moves point to the front of the @var{line}th line,
275counting from line 1 at beginning of buffer. If @var{line} is less than 275counting from line 1 at beginning of the buffer. If @var{line} is less
2761, it moves point to the beginning of the buffer. If @var{line} is 276than 1, it moves point to the beginning of the buffer. If @var{line} is
277greater than the number of lines in the buffer, it moves point to the 277greater than the number of lines in the buffer, it moves point to the
278@emph{end of the last line} of the buffer. 278end of the buffer---that is, the @emph{end of the last line} of the
279buffer. This is the only case in which @code{goto-line} does not
280necessarily move to the beginning of a line.
279 281
280If narrowing is in effect, then @var{line} still counts from the 282If narrowing is in effect, then @var{line} still counts from the
281beginning of the buffer, but point cannot go outside the accessible 283beginning of the buffer, but point cannot go outside the accessible
@@ -285,8 +287,10 @@ position.
285 287
286The return value of @code{goto-line} is the difference between 288The return value of @code{goto-line} is the difference between
287@var{line} and the line number of the line to which point actually was 289@var{line} and the line number of the line to which point actually was
288able move (in the full buffer, disregarding any narrowing). Thus, the 290able to move (in the full buffer, before taking account of narrowing).
289value is positive if the scan encounters the real end of the buffer. 291Thus, the value is positive if the scan encounters the real end of the
292buffer. The value is zero if scan encounters the end of the accessible
293portion but not the real end of the buffer.
290 294
291In an interactive call, @var{line} is the numeric prefix argument if 295In an interactive call, @var{line} is the numeric prefix argument if
292one has been provided. Otherwise @var{line} is read in the minibuffer. 296one has been provided. Otherwise @var{line} is read in the minibuffer.
@@ -298,8 +302,8 @@ argument @var{count} not @code{nil} or 1, it moves forward
298@var{count}@minus{}1 lines and then to the beginning of the line. 302@var{count}@minus{}1 lines and then to the beginning of the line.
299 303
300If this function reaches the end of the buffer (or of the accessible 304If this function reaches the end of the buffer (or of the accessible
301portion, if narrowing is in effect), it positions point at the end of 305portion, if narrowing is in effect), it positions point there. No error
302the buffer. No error is signaled. 306is signaled.
303@end deffn 307@end deffn
304 308
305@deffn Command end-of-line &optional count 309@deffn Command end-of-line &optional count
@@ -308,15 +312,17 @@ argument @var{count} not @code{nil} or 1, it moves forward
308@var{count}@minus{}1 lines and then to the end of the line. 312@var{count}@minus{}1 lines and then to the end of the line.
309 313
310If this function reaches the end of the buffer (or of the accessible 314If this function reaches the end of the buffer (or of the accessible
311portion, if narrowing is in effect), it positions point at the end of 315portion, if narrowing is in effect), it positions point there. No error
312the buffer. No error is signaled. 316is signaled.
313@end deffn 317@end deffn
314 318
315@deffn Command forward-line &optional count 319@deffn Command forward-line &optional count
316@cindex beginning of line 320@cindex beginning of line
317This function moves point forward @var{count} lines, to the beginning of 321This function moves point forward @var{count} lines, to the beginning of
318the line. If @var{count} is negative, it moves point 322the line. If @var{count} is negative, it moves point
319@minus{}@var{count} lines backward, to the beginning of the line. 323@minus{}@var{count} lines backward, to the beginning of a line. If
324@var{count} is zero, it moves point to the beginning of the current
325line.
320 326
321If @code{forward-line} encounters the beginning or end of the buffer (or 327If @code{forward-line} encounters the beginning or end of the buffer (or
322of the accessible portion) before finding that many lines, it sets point 328of the accessible portion) before finding that many lines, it sets point
@@ -435,7 +441,7 @@ continued onto additional screen lines. In these cases,
435@code{vertical-motion} moves point much like @code{forward-line}. 441@code{vertical-motion} moves point much like @code{forward-line}.
436@xref{Truncation}. 442@xref{Truncation}.
437 443
438 Because the width of a given string depends on the flags which control 444 Because the width of a given string depends on the flags that control
439the appearance of certain characters, @code{vertical-motion} behaves 445the appearance of certain characters, @code{vertical-motion} behaves
440differently, for a given piece of text, depending on the buffer it is 446differently, for a given piece of text, depending on the buffer it is
441in, and even on the selected window (because the width, the truncation 447in, and even on the selected window (because the width, the truncation
@@ -462,28 +468,28 @@ This function moves point with respect to the text currently displayed
462in the selected window. It moves point to the beginning of the screen 468in the selected window. It moves point to the beginning of the screen
463line @var{count} screen lines from the top of the window. If 469line @var{count} screen lines from the top of the window. If
464@var{count} is negative, that specifies a position 470@var{count} is negative, that specifies a position
465@w{@minus{}@var{count}} lines from the bottom---or else the last line of 471@w{@minus{}@var{count}} lines from the bottom (or the last line of the
466the buffer, if the buffer ends above the specified screen position. 472buffer, if the buffer ends above the specified screen position).
467 473
468If @var{count} is @code{nil}, then point moves to the beginning of the 474If @var{count} is @code{nil}, then point moves to the beginning of the
469line in the middle of the window. If the absolute value of @var{count} 475line in the middle of the window. If the absolute value of @var{count}
470is greater than the size of the window, then point moves to the place 476is greater than the size of the window, then point moves to the place
471which would appear on that screen line if the window were tall enough. 477that would appear on that screen line if the window were tall enough.
472This will probably cause the next redisplay to scroll to bring that 478This will probably cause the next redisplay to scroll to bring that
473location onto the screen. 479location onto the screen.
474 480
475In an interactive call, @var{count} is the numeric prefix argument. 481In an interactive call, @var{count} is the numeric prefix argument.
476 482
477The value returned is the window line number, with the top line in the 483The value returned is the window line number point has moved to, with
478window numbered 0. 484the top line in the window numbered 0.
479@end deffn 485@end deffn
480 486
481@defun compute-motion from frompos to topos width offsets window 487@defun compute-motion from frompos to topos width offsets window
482This function scan through the current buffer, calculating screen 488This function scans the current buffer, calculating screen positions.
483position. It scans the current buffer forward from position @var{from}, 489It scans the buffer forward from position @var{from}, assuming that is
484assuming that is at screen coordinates @var{frompos}, to position 490at screen coordinates @var{frompos}, to position @var{to} or coordinates
485@var{to} or coordinates @var{topos}, whichever comes first. It returns 491@var{topos}, whichever comes first. It returns the ending buffer
486the ending buffer position and screen coordinates. 492position and screen coordinates.
487 493
488The coordinate arguments @var{frompos} and @var{topos} are cons cells of 494The coordinate arguments @var{frompos} and @var{topos} are cons cells of
489the form @code{(@var{hpos} . @var{vpos})}. 495the form @code{(@var{hpos} . @var{vpos})}.
@@ -501,9 +507,9 @@ column numbers in the buffer. This can be nonzero in a continuation
501line, when the previous screen lines' widths do not add up to a multiple 507line, when the previous screen lines' widths do not add up to a multiple
502of @code{tab-width}. It is always zero in a non-continuation line. 508of @code{tab-width}. It is always zero in a non-continuation line.
503 509
504The window @var{window} serves to specify which display table to use; 510The window @var{window} serves only to specify which display table to
505that is its only effect. @code{compute-motion} always operates on the 511use. @code{compute-motion} always operates on the current buffer,
506current buffer, regardless of what buffer is displayed in @var{window}. 512regardless of what buffer is displayed in @var{window}.
507 513
508The return value is a list of five elements: 514The return value is a list of five elements:
509 515
@@ -513,27 +519,29 @@ The return value is a list of five elements:
513 519
514@noindent 520@noindent
515Here @var{pos} is the buffer position where the scan stopped, @var{vpos} 521Here @var{pos} is the buffer position where the scan stopped, @var{vpos}
516is the vertical position, and @var{hpos} is the horizontal position. 522is the vertical screen position, and @var{hpos} is the horizontal screen
523position.
517 524
518The result @var{prevhpos} is the horizontal position one character back 525The result @var{prevhpos} is the horizontal position one character back
519from @var{pos}. The result @var{contin} is @code{t} if a line was 526from @var{pos}. The result @var{contin} is @code{t} if the last line
520continued after (or within) the previous character. 527was continued after (or within) the previous character.
521 528
522For example, to find the buffer position of column @var{col} of line 529For example, to find the buffer position of column @var{col} of line
523@var{line} of a certain window, pass the window's display start location 530@var{line} of a certain window, pass the window's display start location
524as @var{from} and the window's upper-left coordinates as @var{frompos}. 531as @var{from} and the window's upper-left coordinates as @var{frompos}.
525Pass the buffer's @code{(point-max)} as @var{to}, to limit the scan to 532Pass the buffer's @code{(point-max)} as @var{to}, to limit the scan to
526the end of the visible section of the buffer, and pass @var{line} and 533the end of the accessible portion of the buffer, and pass @var{line} and
527@var{col} as @var{topos}. Here's a function that does this: 534@var{col} as @var{topos}. Here's a function that does this:
528 535
529@example 536@example
530(defun coordinates-of-position (col line) 537(defun coordinates-of-position (col line)
531 (car (compute-motion (window-start) 538 (car (compute-motion (window-start)
532 '(0 . 0) 539 '(0 . 0)
533 (point) 540 (point-max)
534 (cons col line) 541 (cons col line)
535 (window-width) 542 (window-width)
536 (cons (window-hscroll) 0)))) 543 (cons (window-hscroll) 0)
544 (selected-window))))
537@end example 545@end example
538 546
539When you use @code{compute-motion} for the minibuffer, you need to use 547When you use @code{compute-motion} for the minibuffer, you need to use
@@ -575,9 +583,10 @@ a vertical motion command.
575This variable controls how the vertical line motion commands operate 583This variable controls how the vertical line motion commands operate
576when starting at the end of a line. If @code{track-eol} is 584when starting at the end of a line. If @code{track-eol} is
577non-@code{nil}, then vertical motion starting at the end of a line will 585non-@code{nil}, then vertical motion starting at the end of a line will
578keep to the ends of lines. This means moving to the end of each line 586keep to the ends of lines (instead of keeping to a particular column).
579moved onto. The value of @code{track-eol} has no effect if point is not 587This means moving to the end of each line moved onto. The value of
580at the end of a line when the first vertical motion command is given. 588@code{track-eol} has no effect if point is not at the end of a line when
589the first vertical motion command is given.
581 590
582@code{track-eol} has its effect by telling line motion commands to set 591@code{track-eol} has its effect by telling line motion commands to set
583@code{temporary-goal-column} to 9999 instead of to the current column. 592@code{temporary-goal-column} to 9999 instead of to the current column.
@@ -616,9 +625,9 @@ A negative argument means move backward but still to a less deep spot.
616@end deffn 625@end deffn
617 626
618@deffn Command down-list arg 627@deffn Command down-list arg
619This function moves forward down @var{arg} levels of parentheses. A 628This function moves forward into @var{arg} levels of parentheses. A
620negative argument means move backward but still go down @var{arg} 629negative argument means move backward but still go @var{arg} levels
621levels. 630deeper in parentheses.
622@end deffn 631@end deffn
623 632
624@deffn Command forward-sexp arg 633@deffn Command forward-sexp arg
@@ -655,17 +664,17 @@ to the beginning of a defun, not to the end of one.
655@end deffn 664@end deffn
656 665
657@deffn Command end-of-defun arg 666@deffn Command end-of-defun arg
658Move forward to the @var{arg}th end of a defun. If @var{arg} is 667This function moves forward to the @var{arg}th end of a defun. If
659negative, this actually moves backward, but it still moves to the end of 668@var{arg} is negative, this actually moves backward, but it still moves
660a defun, not to the beginning of one. 669to the end of a defun, not to the beginning of one.
661@end deffn 670@end deffn
662 671
663@defopt defun-prompt-regexp 672@defopt defun-prompt-regexp
664If non-@code{nil}, this variable holds a regular expression that 673If non-@code{nil}, this variable holds a regular expression that
665specifies what text can appear before the open-parenthesis that starts a 674specifies what text can appear before the open-parenthesis that starts a
666defun. That is to say, the a defun begins on a line which starts 675defun. That is to say, a defun begins on a line that starts with a
667with a match for this regular expression, followed by a character 676match for this regular expression, followed by a character with
668with open-parenthesis syntax. 677open-parenthesis syntax.
669@end defopt 678@end defopt
670 679
671@node Skipping Characters 680@node Skipping Characters
@@ -746,10 +755,10 @@ Configurations}).
746@cindex point excursion 755@cindex point excursion
747@cindex current buffer excursion 756@cindex current buffer excursion
748The @code{save-excursion} special form saves the identity of the current 757The @code{save-excursion} special form saves the identity of the current
749buffer and the values of point and the mark in it, evaluates @var{forms}, 758buffer and the values of point and the mark in it, evaluates
750and finally restores the buffer and its saved values of point and the mark. 759@var{forms}, and finally restores the buffer and its saved values of
751All three saved values are restored even in case of an abnormal exit 760point and the mark. All three saved values are restored even in case of
752via throw or error (@pxref{Nonlocal Exits}). 761an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
753 762
754The @code{save-excursion} special form is the standard way to switch 763The @code{save-excursion} special form is the standard way to switch
755buffers or move point within one part of a program and avoid affecting 764buffers or move point within one part of a program and avoid affecting
@@ -805,12 +814,12 @@ beginning and end of the buffer. While narrowing is in effect, no text
805outside the accessible portion is displayed, and point cannot move 814outside the accessible portion is displayed, and point cannot move
806outside the accessible portion. 815outside the accessible portion.
807 816
808 Values such as positions or line numbers, that usually count from the 817 Values such as positions or line numbers, which usually count from the
809beginning of the buffer, do so despite narrowing, but the functions 818beginning of the buffer, do so despite narrowing, but the functions
810which use them refuse to operate on text that is inaccessible. 819which use them refuse to operate on text that is inaccessible.
811 820
812 The commands for saving buffers are unaffected by narrowing; they save 821 The commands for saving buffers are unaffected by narrowing; they save
813the entire buffer regardless of the any narrowing. 822the entire buffer regardless of any narrowing.
814 823
815@deffn Command narrow-to-region start end 824@deffn Command narrow-to-region start end
816This function sets the accessible portion of the current buffer to start 825This function sets the accessible portion of the current buffer to start
@@ -849,8 +858,8 @@ This special form saves the current bounds of the accessible portion,
849evaluates the @var{body} forms, and finally restores the saved bounds, 858evaluates the @var{body} forms, and finally restores the saved bounds,
850thus restoring the same state of narrowing (or absence thereof) formerly 859thus restoring the same state of narrowing (or absence thereof) formerly
851in effect. The state of narrowing is restored even in the event of an 860in effect. The state of narrowing is restored even in the event of an
852abnormal exit via throw or error (@pxref{Nonlocal Exits}). Therefore, 861abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
853this construct is a clean way to narrow a buffer temporarily. 862Therefore, this construct is a clean way to narrow a buffer temporarily.
854 863
855The value returned by @code{save-restriction} is that returned by the 864The value returned by @code{save-restriction} is that returned by the
856last form in @var{body}, or @code{nil} if no body forms were given. 865last form in @var{body}, or @code{nil} if no body forms were given.