comparison lispref/positions.texi @ 59943:1b1724ddcdad

(Character Motion): Mention default arg for forward-char. backward-char refers to forward-char. (Word Motion): Mention default arg for forward-word. (Buffer End Motion): Mention default arg for beginning-of-buffer. Simplify end-of-buffer. (Text Lines): Mention default arg for forward-line. (List Motion): Mention default arg for beginning/end-of-defun. (Skipping Characters): Minor fixes in explaining character-set.
author Richard M. Stallman <rms@gnu.org>
date Sun, 06 Feb 2005 10:54:05 +0000
parents b40efffdf96e
children 2d8b73599b7b 3ebd9bdb4fe5
comparison
equal deleted inserted replaced
59942:1f6a9cf44999 59943:1b1724ddcdad
163 @deffn Command forward-char &optional count 163 @deffn Command forward-char &optional count
164 @c @kindex beginning-of-buffer 164 @c @kindex beginning-of-buffer
165 @c @kindex end-of-buffer 165 @c @kindex end-of-buffer
166 This function moves point @var{count} characters forward, towards the 166 This function moves point @var{count} characters forward, towards the
167 end of the buffer (or backward, towards the beginning of the buffer, if 167 end of the buffer (or backward, towards the beginning of the buffer, if
168 @var{count} is negative). If the function attempts to move point past 168 @var{count} is negative). If @var{count} is @code{nil}, the default
169 the beginning or end of the buffer (or the limits of the accessible 169 is 1.
170 portion, when narrowing is in effect), an error is signaled with error 170
171 code @code{beginning-of-buffer} or @code{end-of-buffer}. 171 If this attempts to move past the beginning or end of the buffer (or
172 the limits of the accessible portion, when narrowing is in effect), it
173 signals an error with error symbol @code{beginning-of-buffer} or
174 @code{end-of-buffer}.
172 175
173 In an interactive call, @var{count} is the numeric prefix argument. 176 In an interactive call, @var{count} is the numeric prefix argument.
174 @end deffn 177 @end deffn
175 178
176 @deffn Command backward-char &optional count 179 @deffn Command backward-char &optional count
177 This function moves point @var{count} characters backward, towards the 180 This is just like @code{forward-char} except that it moves
178 beginning of the buffer (or forward, towards the end of the buffer, if 181 in the opposite direction.
179 @var{count} is negative). If the function attempts to move point past
180 the beginning or end of the buffer (or the limits of the accessible
181 portion, when narrowing is in effect), an error is signaled with error
182 code @code{beginning-of-buffer} or @code{end-of-buffer}.
183
184 In an interactive call, @var{count} is the numeric prefix argument.
185 @end deffn 182 @end deffn
186 183
187 @node Word Motion 184 @node Word Motion
188 @subsection Motion by Words 185 @subsection Motion by Words
189 186
190 These functions for parsing words use the syntax table to decide 187 These functions for parsing words use the syntax table to decide
191 whether a given character is part of a word. @xref{Syntax Tables}. 188 whether a given character is part of a word. @xref{Syntax Tables}.
192 189
193 @deffn Command forward-word &optional count 190 @deffn Command forward-word &optional count
194 This function moves point forward @var{count} words (or backward if 191 This function moves point forward @var{count} words (or backward if
195 @var{count} is negative). ``Moving one word'' means moving until point 192 @var{count} is negative). If @var{count} is @code{nil}, it moves
196 crosses a word-constituent character and then encounters a 193 forward one word.
197 word-separator character. However, this function cannot move point past 194
198 the boundary of the accessible portion of the buffer, or across a field 195 ``Moving one word'' means moving until point crosses a
199 boundary (@pxref{Fields}). The most common case of a field boundary is 196 word-constituent character and then encounters a word-separator
200 the end of the prompt in the minibuffer. 197 character. However, this function cannot move point past the boundary
198 of the accessible portion of the buffer, or across a field boundary
199 (@pxref{Fields}). The most common case of a field boundary is the end
200 of the prompt in the minibuffer.
201 201
202 If it is possible to move @var{count} words, without being stopped 202 If it is possible to move @var{count} words, without being stopped
203 prematurely by the buffer boundary or a field boundary, the value is 203 prematurely by the buffer boundary or a field boundary, the value is
204 @code{t}. Otherwise, the return value is @code{nil} and point stops at 204 @code{t}. Otherwise, the return value is @code{nil} and point stops at
205 the buffer boundary or field boundary. 205 the buffer boundary or field boundary.
256 they set the mark and display messages in the echo area. 256 they set the mark and display messages in the echo area.
257 257
258 @deffn Command beginning-of-buffer &optional n 258 @deffn Command beginning-of-buffer &optional n
259 This function moves point to the beginning of the buffer (or the limits 259 This function moves point to the beginning of the buffer (or the limits
260 of the accessible portion, when narrowing is in effect), setting the 260 of the accessible portion, when narrowing is in effect), setting the
261 mark at the previous position. If @var{n} is non-@code{nil}, then it 261 mark at the previous position (except in Transient Mark mode, if
262 puts point @var{n} tenths of the way from the beginning of the 262 the mark is already active, it does not set the mark.)
263 accessible portion of the buffer. 263
264 264 If @var{n} is non-@code{nil}, then it puts point @var{n} tenths of the
265 In an interactive call, @var{n} is the numeric prefix argument, 265 way from the beginning of the accessible portion of the buffer. In an
266 if provided; otherwise @var{n} defaults to @code{nil}. 266 interactive call, @var{n} is the numeric prefix argument, if provided;
267 otherwise @var{n} defaults to @code{nil}.
267 268
268 @strong{Warning:} Don't use this function in Lisp programs! 269 @strong{Warning:} Don't use this function in Lisp programs!
269 @end deffn 270 @end deffn
270 271
271 @deffn Command end-of-buffer &optional n 272 @deffn Command end-of-buffer &optional n
272 This function moves point to the end of the buffer (or the limits of the 273 This function moves point to the end of the buffer (or the limits of
273 accessible portion, when narrowing is in effect), setting the mark at 274 the accessible portion, when narrowing is in effect), setting the mark
274 the previous position. If @var{n} is non-@code{nil}, then it puts point 275 at the previous position (except in Transient Mark mode when the mark
275 @var{n} tenths of the way from the end of the accessible portion of the 276 is already active). If @var{n} is non-@code{nil}, then it puts point
276 buffer. 277 @var{n} tenths of the way from the end of the accessible portion of
278 the buffer.
277 279
278 In an interactive call, @var{n} is the numeric prefix argument, 280 In an interactive call, @var{n} is the numeric prefix argument,
279 if provided; otherwise @var{n} defaults to @code{nil}. 281 if provided; otherwise @var{n} defaults to @code{nil}.
280 282
281 @strong{Warning:} Don't use this function in Lisp programs! 283 @strong{Warning:} Don't use this function in Lisp programs!
371 @cindex beginning of line 373 @cindex beginning of line
372 This function moves point forward @var{count} lines, to the beginning of 374 This function moves point forward @var{count} lines, to the beginning of
373 the line. If @var{count} is negative, it moves point 375 the line. If @var{count} is negative, it moves point
374 @minus{}@var{count} lines backward, to the beginning of a line. If 376 @minus{}@var{count} lines backward, to the beginning of a line. If
375 @var{count} is zero, it moves point to the beginning of the current 377 @var{count} is zero, it moves point to the beginning of the current
376 line. 378 line. If @var{count} is @code{nil}, that means 1.
377 379
378 If @code{forward-line} encounters the beginning or end of the buffer (or 380 If @code{forward-line} encounters the beginning or end of the buffer (or
379 of the accessible portion) before finding that many lines, it sets point 381 of the accessible portion) before finding that many lines, it sets point
380 there. No error is signaled. 382 there. No error is signaled.
381 383
701 @end deffn 703 @end deffn
702 704
703 @deffn Command beginning-of-defun &optional arg 705 @deffn Command beginning-of-defun &optional arg
704 This function moves back to the @var{arg}th beginning of a defun. If 706 This function moves back to the @var{arg}th beginning of a defun. If
705 @var{arg} is negative, this actually moves forward, but it still moves 707 @var{arg} is negative, this actually moves forward, but it still moves
706 to the beginning of a defun, not to the end of one. 708 to the beginning of a defun, not to the end of one. @var{arg} defaults
709 to 1.
707 @end deffn 710 @end deffn
708 711
709 @deffn Command end-of-defun &optional arg 712 @deffn Command end-of-defun &optional arg
710 This function moves forward to the @var{arg}th end of a defun. If 713 This function moves forward to the @var{arg}th end of a defun. If
711 @var{arg} is negative, this actually moves backward, but it still moves 714 @var{arg} is negative, this actually moves backward, but it still moves
712 to the end of a defun, not to the beginning of one. 715 to the end of a defun, not to the beginning of one. @var{arg} defaults
716 to 1.
713 @end deffn 717 @end deffn
714 718
715 @defopt defun-prompt-regexp 719 @defopt defun-prompt-regexp
716 If non-@code{nil}, this variable holds a regular expression that 720 If non-@code{nil}, this variable holds a regular expression that
717 specifies what text can appear before the open-parenthesis that starts a 721 specifies what text can appear before the open-parenthesis that starts a
759 given set of characters. It examines the character following point, 763 given set of characters. It examines the character following point,
760 then advances point if the character matches @var{character-set}. This 764 then advances point if the character matches @var{character-set}. This
761 continues until it reaches a character that does not match. The 765 continues until it reaches a character that does not match. The
762 function returns the number of characters moved over. 766 function returns the number of characters moved over.
763 767
764 The argument @var{character-set} is like the inside of a 768 The argument @var{character-set} is a string, like the inside of a
765 @samp{[@dots{}]} in a regular expression except that @samp{]} is never 769 @samp{[@dots{}]} in a regular expression except that @samp{]} does not
766 special and @samp{\} quotes @samp{^}, @samp{-} or @samp{\}. Thus, 770 terminate it, and @samp{\} quotes @samp{^}, @samp{-} or @samp{\}.
767 @code{"a-zA-Z"} skips over all letters, stopping before the first 771 Thus, @code{"a-zA-Z"} skips over all letters, stopping before the
768 nonletter, and @code{"^a-zA-Z"} skips nonletters stopping before the 772 first nonletter, and @code{"^a-zA-Z"} skips nonletters stopping before
769 first letter. @xref{Regular Expressions}. 773 the first letter. @xref{Regular Expressions}.
770 774
771 If @var{limit} is supplied (it must be a number or a marker), it 775 If @var{limit} is supplied (it must be a number or a marker), it
772 specifies the maximum position in the buffer that point can be skipped 776 specifies the maximum position in the buffer that point can be skipped
773 to. Point will stop at or before @var{limit}. 777 to. Point will stop at or before @var{limit}.
774 778