merge whitespace.el change from trunk
[bpt/emacs.git] / doc / lispref / positions.texi
index 3e1d79a..3a6fc6f 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/positions
 @node Positions, Markers, Frames, Top
@@ -220,13 +220,13 @@ This function is just like @code{forward-word}, except that it moves
 backward until encountering the front of a word, rather than forward.
 @end deffn
 
-@defvar words-include-escapes
+@defopt words-include-escapes
 @c Emacs 19 feature
 This variable affects the behavior of @code{forward-word} and everything
 that uses it.  If it is non-@code{nil}, then characters in the
 ``escape'' and ``character quote'' syntax classes count as part of
 words.  Otherwise, they do not.
-@end defvar
+@end defopt
 
 @defvar inhibit-field-text-motion
 If this variable is non-@code{nil}, certain motion functions including
@@ -299,33 +299,6 @@ The division of the buffer into text lines is not affected by the width
 of the window, by line continuation in display, or by how tabs and
 control characters are displayed.
 
-@deffn Command goto-line line
-This function moves point to the front of the @var{line}th line,
-counting from line 1 at beginning of the buffer.  If @var{line} is less
-than 1, it moves point to the beginning of the buffer.  If @var{line} is
-greater than the number of lines in the buffer, it moves point to the
-end of the buffer---that is, the @emph{end of the last line} of the
-buffer.  This is the only case in which @code{goto-line} does not
-necessarily move to the beginning of a line.
-
-If narrowing is in effect, then @var{line} still counts from the
-beginning of the buffer, but point cannot go outside the accessible
-portion.  So @code{goto-line} moves point to the beginning or end of the
-accessible portion, if the line number specifies an inaccessible
-position.
-
-The return value of @code{goto-line} is the difference between
-@var{line} and the line number of the line to which point actually was
-able to move (in the full buffer, before taking account of narrowing).
-Thus, the value is positive if the scan encounters the real end of the
-buffer before finding the specified line.  The value is zero if scan
-encounters the end of the accessible portion but not the real end of the
-buffer.
-
-In an interactive call, @var{line} is the numeric prefix argument if
-one has been provided.  Otherwise @var{line} is read in the minibuffer.
-@end deffn
-
 @deffn Command beginning-of-line &optional count
 This function moves point to the beginning of the current line.  With an
 argument @var{count} not @code{nil} or 1, it moves forward
@@ -520,9 +493,14 @@ This function moves point to the start of the screen line @var{count}
 screen lines down from the screen line containing point.  If @var{count}
 is negative, it moves up instead.
 
-@code{vertical-motion} returns the number of screen lines over which it
-moved point.  The value may be less in absolute value than @var{count}
-if the beginning or end of the buffer was reached.
+The @var{count} argument can be a cons cell, @code{(@var{cols}
+. @var{lines})}, instead of an integer.  Then the function moves by
+@var{lines} screen lines, and puts point @var{cols} columns from the
+start of that screen line.
+
+The return value is the number of screen lines over which point was
+moved.  The value may be less in absolute value than @var{count} if
+the beginning or end of the buffer was reached.
 
 The window @var{window} is used for obtaining parameters such as the
 width, the horizontal scrolling, and the display table.  But
@@ -737,7 +715,10 @@ The default is @code{t}.
 @defvar beginning-of-defun-function
 If non-@code{nil}, this variable holds a function for finding the
 beginning of a defun.  The function @code{beginning-of-defun}
-calls this function instead of using its normal method.
+calls this function instead of using its normal method, passing it its
+optional argument.  If the argument is non-@code{nil}, the function
+should move back by that many functions, like
+@code{beginning-of-defun} does.
 @end defvar
 
 @defvar end-of-defun-function
@@ -793,7 +774,7 @@ comes back" twice.
 
 @group
 (skip-chars-forward "a-zA-Z ")
-     @result{} nil
+     @result{} 18
 
 ---------- Buffer: foo ----------
 I read "The cat in the hat@point{}
@@ -825,7 +806,9 @@ after the completion of the excursion.
 
   The forms for saving and restoring the configuration of windows are
 described elsewhere (see @ref{Window Configurations}, and @pxref{Frame
-Configurations}).
+Configurations}).  When only the identity of the current buffer needs
+to be saved and restored, it is preferable to use
+@code{save-current-buffer} instead.
 
 @defspec save-excursion body@dots{}
 @cindex mark excursion
@@ -836,10 +819,10 @@ buffer and the values of point and the mark in it, evaluates
 point and the mark.  All three saved values are restored even in case of
 an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
 
-The @code{save-excursion} special form is the standard way to switch
-buffers or move point within one part of a program and avoid affecting
-the rest of the program.  It is used more than 4000 times in the Lisp
-sources of Emacs.
+The @code{save-excursion} special form is the standard way to move
+point within one part of a program and avoid affecting the rest of the
+program.  It is used more than 4000 times in the Lisp sources
+of Emacs.
 
 @code{save-excursion} does not save the values of point and the mark for
 other buffers, so changes in other buffers remain in effect after
@@ -909,6 +892,10 @@ which use them refuse to operate on text that is inaccessible.
   The commands for saving buffers are unaffected by narrowing; they save
 the entire buffer regardless of any narrowing.
 
+  If you need to display in a single buffer several very different
+types of text, consider using an alternative facility described in
+@ref{Swapping Text}.
+
 @deffn Command narrow-to-region start end
 This function sets the accessible portion of the current buffer to start
 at @var{start} and end at @var{end}.  Both arguments should be character