summaryrefslogtreecommitdiff
path: root/doc/emacs/basic.texi
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-10-08 12:37:46 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-10-08 12:37:46 -0400
commitb2b0776e50cd07bc3fbe1548fc258d68a1dbbee8 (patch)
treeca33e46f624b6171b21ee79d9824e62bd88682d0 /doc/emacs/basic.texi
parent27a16462454d7f45a0b1c65c0b0b2ed76091e11b (diff)
downloademacs-b2b0776e50cd07bc3fbe1548fc258d68a1dbbee8.tar.gz
emacs-b2b0776e50cd07bc3fbe1548fc258d68a1dbbee8.tar.bz2
emacs-b2b0776e50cd07bc3fbe1548fc258d68a1dbbee8.zip
Rework count-words-region. New command count-words.
See discussion at http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00193.html * lisp/simple.el (count-words-region): Always count in the region. Report the number of lines and characters too. (count-words): New command, which counts in the buffer if the region is inactive, as count-words-region used to. (count-words--message): New function. Handle plurals. (count-lines-region): Make it an alias for count-words-region. * lisp/bindings.el (esc-map): Replace count-lines-region with count-words-region. * doc/emacs/basic.texi (Position Info): Omit page commands. Document count-words-region and count-words. * doc/emacs/text.texi (Pages): Move what-page documentation here.
Diffstat (limited to 'doc/emacs/basic.texi')
-rw-r--r--doc/emacs/basic.texi39
1 files changed, 17 insertions, 22 deletions
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index 52f9395cedc..e4e7dadd548 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -23,7 +23,7 @@ suggest you first run the Emacs learn-by-doing tutorial, by typing
* Help: Basic Help. Asking what a character does.
* Blank Lines:: Making and deleting blank lines.
* Continuation Lines:: How Emacs displays lines too wide for the screen.
-* Position Info:: What page, line, row, or column is point on?
+* Position Info:: What line, row, or column is point on?
* Arguments:: Numeric arguments for repeating a command N times.
* Repeating:: Repeating the previous command quickly.
@end menu
@@ -569,28 +569,26 @@ logical lines. @xref{Visual Line Mode}.
@section Cursor Position Information
Here are commands to get information about the size and position of
-parts of the buffer, and to count lines.
+parts of the buffer, and to count words and lines.
@table @kbd
-@item M-x what-page
-Display the page number of point, and the line number within that page.
@item M-x what-line
-Display the line number of point in the whole buffer.
+Display the line number of point.
@item M-x line-number-mode
@itemx M-x column-number-mode
Toggle automatic display of the current line number or column number.
@xref{Optional Mode Line}.
@item M-=
-Display the number of lines in the region (@code{count-lines-region}).
-@xref{Mark}, for information about the region.
+Display the number of lines, words, and characters that are present in
+the region (@code{count-words-region}). @xref{Mark}, for information
+about the region.
-@item C-x l
-Display the number of lines in the current page
-(@code{count-lines-page}). @xref{Pages}.
+@item M-x count-words
+Display the number of lines, words, and characters that are present in
+the buffer. If the region is active (@pxref{Mark}), display the
+numbers for the region instead.
-@item M-x count-words-region
-Display the number of words in the region.
@item C-x =
Display the character code of character after point, character position of
point, and column of point (@code{what-cursor-position}).
@@ -602,7 +600,6 @@ Toggle automatic display of the size of the buffer.
@xref{Optional Mode Line}.
@end table
-@findex what-page
@findex what-line
@cindex line number commands
@cindex location of point
@@ -616,16 +613,14 @@ the accessible portion (@pxref{Narrowing}). By contrast,
@code{what-line} displays both the line number relative to the
narrowed region and the line number relative to the whole buffer.
- @kbd{M-x what-page} counts pages from the beginning of the file, and
-counts lines within the page, showing both numbers in the echo area.
-@xref{Pages}.
-
@kindex M-=
-@findex count-lines-region
- @kbd{M-=} (@code{count-lines-region}) displays the number of lines
-in the region (@pxref{Mark}), while @kbd{C-x l}
-(@code{count-lines-page}) counts the lines in the current page
-(@pxref{Pages}).
+@findex count-words-region
+@findex count-words
+ @kbd{M-=} (@code{count-words-region}) displays a message reporting
+the number of lines, words, and characters in the region. @kbd{M-x
+count-words} displays a similar message for the entire buffer, or for
+the region if the region is @dfn{active}. @xref{Mark}, for an
+explanation of the region.
@kindex C-x =
@findex what-cursor-position