comparison lispref/positions.texi @ 25751:467b88fab665

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Fri, 17 Sep 1999 06:59:04 +0000
parents 80ac191b6d2b
children ef5e7bbe6f19
comparison
equal deleted inserted replaced
25750:f1968a807f56 25751:467b88fab665
40 than a particular character. Usually terminals display the cursor over 40 than a particular character. Usually terminals display the cursor over
41 the character that immediately follows point; point is actually before 41 the character that immediately follows point; point is actually before
42 the character on which the cursor sits. 42 the character on which the cursor sits.
43 43
44 @cindex point with narrowing 44 @cindex point with narrowing
45 The value of point is a number between 1 and the buffer size plus 1. 45 The value of point is a number no less than 1, and no greater than the
46 If narrowing is in effect (@pxref{Narrowing}), then point is constrained 46 buffer size plus 1. If narrowing is in effect (@pxref{Narrowing}), then
47 to fall within the accessible portion of the buffer (possibly at one end 47 point is constrained to fall within the accessible portion of the buffer
48 of it). 48 (possibly at one end of it).
49 49
50 Each buffer has its own value of point, which is independent of the 50 Each buffer has its own value of point, which is independent of the
51 value of point in other buffers. Each window also has a value of point, 51 value of point in other buffers. Each window also has a value of point,
52 which is independent of the value of point in other windows on the same 52 which is independent of the value of point in other windows on the same
53 buffer. This is why point can have different values in various windows 53 buffer. This is why point can have different values in various windows
79 79
80 @defun point-max 80 @defun point-max
81 This function returns the maximum accessible value of point in the 81 This function returns the maximum accessible value of point in the
82 current buffer. This is @code{(1+ (buffer-size))}, unless narrowing is 82 current buffer. This is @code{(1+ (buffer-size))}, unless narrowing is
83 in effect, in which case it is the position of the end of the region 83 in effect, in which case it is the position of the end of the region
84 that you narrowed to. (@pxref{Narrowing}). 84 that 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, 88 This 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 &optional buffer
93 This function returns the total number of characters in the current 93 This function returns the total number of characters in the current
94 buffer. In the absence of any narrowing (@pxref{Narrowing}), 94 buffer. 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
97 If you specify a buffer, @var{buffer}, then the value is the
98 size of @var{buffer}.
96 99
97 @example 100 @example
98 @group 101 @group
99 (buffer-size) 102 (buffer-size)
100 @result{} 35 103 @result{} 35
188 If it is possible to move @var{count} words, without being stopped by 191 If it is possible to move @var{count} words, without being stopped by
189 the buffer boundary (except perhaps after the last word), the value is 192 the buffer boundary (except perhaps after the last word), the value is
190 @code{t}. Otherwise, the return value is @code{nil} and point stops 193 @code{t}. Otherwise, the return value is @code{nil} and point stops
191 at the buffer boundary. 194 at the buffer boundary.
192 195
196 In the minibuffer, the end of the prompt always acts as a word boundary,
197 regardless of what characters appear before and after it.
198
193 In an interactive call, @var{count} is set to the numeric prefix 199 In an interactive call, @var{count} is set to the numeric prefix
194 argument. 200 argument.
195 @end deffn 201 @end deffn
196 202
197 @deffn Command backward-word count 203 @deffn Command backward-word count
239 245
240 @deffn Command beginning-of-buffer &optional n 246 @deffn Command beginning-of-buffer &optional n
241 This function moves point to the beginning of the buffer (or the limits 247 This function moves point to the beginning of the buffer (or the limits
242 of the accessible portion, when narrowing is in effect), setting the 248 of the accessible portion, when narrowing is in effect), setting the
243 mark at the previous position. If @var{n} is non-@code{nil}, then it 249 mark at the previous position. If @var{n} is non-@code{nil}, then it
244 puts point @var{n} tenths of the way from the beginning of the buffer. 250 puts point @var{n} tenths of the way from the beginning of the
251 accessible portion of the buffer.
245 252
246 In an interactive call, @var{n} is the numeric prefix argument, 253 In an interactive call, @var{n} is the numeric prefix argument,
247 if provided; otherwise @var{n} defaults to @code{nil}. 254 if provided; otherwise @var{n} defaults to @code{nil}.
248 255
249 @strong{Warning:} Don't use this function in Lisp programs! 256 @strong{Warning:} Don't use this function in Lisp programs!
250 @end deffn 257 @end deffn
251 258
252 @deffn Command end-of-buffer &optional n 259 @deffn Command end-of-buffer &optional n
253 This function moves point to the end of the buffer (or the limits of 260 This function moves point to the end of the buffer (or the limits of the
254 the accessible portion, when narrowing is in effect), setting the mark 261 accessible portion, when narrowing is in effect), setting the mark at
255 at the previous position. If @var{n} is non-@code{nil}, then it puts 262 the previous position. If @var{n} is non-@code{nil}, then it puts point
256 point @var{n} tenths of the way from the end of the buffer. 263 @var{n} tenths of the way from the end of the accessible portion of the
264 buffer.
257 265
258 In an interactive call, @var{n} is the numeric prefix argument, 266 In an interactive call, @var{n} is the numeric prefix argument,
259 if provided; otherwise @var{n} defaults to @code{nil}. 267 if provided; otherwise @var{n} defaults to @code{nil}.
260 268
261 @strong{Warning:} Don't use this function in Lisp programs! 269 @strong{Warning:} Don't use this function in Lisp programs!
306 @var{count}@minus{}1 lines and then to the beginning of the line. 314 @var{count}@minus{}1 lines and then to the beginning of the line.
307 315
308 If this function reaches the end of the buffer (or of the accessible 316 If this function reaches the end of the buffer (or of the accessible
309 portion, if narrowing is in effect), it positions point there. No error 317 portion, if narrowing is in effect), it positions point there. No error
310 is signaled. 318 is signaled.
319
320 As a special feature, in the minibuffer, this command will not
321 move back into the prompt, if it starts from after the prompt.
311 @end deffn 322 @end deffn
312 323
313 @defun line-beginning-position &optional count 324 @defun line-beginning-position &optional count
314 @tindex line-beginning-position 325 @tindex line-beginning-position
315 Return the position that @code{(beginning-of-line @var{count})} 326 Return the position that @code{(beginning-of-line @var{count})}
582 Here are several functions concerned with balanced-parenthesis 593 Here are several functions concerned with balanced-parenthesis
583 expressions (also called @dfn{sexps} in connection with moving across 594 expressions (also called @dfn{sexps} in connection with moving across
584 them in Emacs). The syntax table controls how these functions interpret 595 them in Emacs). The syntax table controls how these functions interpret
585 various characters; see @ref{Syntax Tables}. @xref{Parsing 596 various characters; see @ref{Syntax Tables}. @xref{Parsing
586 Expressions}, for lower-level primitives for scanning sexps or parts of 597 Expressions}, for lower-level primitives for scanning sexps or parts of
587 sexps. For user-level commands, see @ref{Lists Commands,,, emacs, GNU 598 sexps. For user-level commands, see @ref{Lists Commands,,, emacs, The GNU
588 Emacs Manual}. 599 Emacs Manual}.
589 600
590 @deffn Command forward-list arg 601 @deffn Command forward-list arg
591 This function moves forward across @var{arg} balanced groups of 602 This function moves forward across @var{arg} balanced groups of
592 parentheses. (Other syntactic entities such as words or paired string 603 parentheses. (Other syntactic entities such as words or paired string
723 @cindex excursion 734 @cindex excursion
724 735
725 It is often useful to move point ``temporarily'' within a localized 736 It is often useful to move point ``temporarily'' within a localized
726 portion of the program, or to switch buffers temporarily. This is 737 portion of the program, or to switch buffers temporarily. This is
727 called an @dfn{excursion}, and it is done with the @code{save-excursion} 738 called an @dfn{excursion}, and it is done with the @code{save-excursion}
728 special form. This construct saves the current buffer and its values of 739 special form. This construct initially remembers the identity of the
729 point and the mark so they can be restored after the completion of the 740 current buffer, and its values of point and the mark, and restores them
730 excursion. 741 after the completion of the excursion.
731 742
732 The forms for saving and restoring the configuration of windows are 743 The forms for saving and restoring the configuration of windows are
733 described elsewhere (see @ref{Window Configurations}, and @pxref{Frame 744 described elsewhere (see @ref{Window Configurations}, and @pxref{Frame
734 Configurations}). 745 Configurations}).
735 746