diff options
| author | Chong Yidong | 2012-03-05 14:12:17 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-03-05 14:12:17 +0800 |
| commit | ef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86 (patch) | |
| tree | 9c6a51a3174b84e0e2991ec26278ea33818bc3f6 | |
| parent | 10607bea34d2cddc62761df6c88d674c2861e71d (diff) | |
| download | emacs-ef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86.tar.gz emacs-ef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86.zip | |
* doc/lispref/positions.texi (Text Lines): Document count-words.
| -rw-r--r-- | admin/FOR-RELEASE | 2 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/positions.texi | 19 |
3 files changed, 14 insertions, 11 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 636d400f5cb..99b702ad30f 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -219,7 +219,7 @@ numbers.texi cyd | |||
| 219 | objects.texi cyd | 219 | objects.texi cyd |
| 220 | os.texi | 220 | os.texi |
| 221 | package.texi | 221 | package.texi |
| 222 | positions.texi | 222 | positions.texi cyd |
| 223 | processes.texi | 223 | processes.texi |
| 224 | searching.texi | 224 | searching.texi |
| 225 | sequences.texi cyd | 225 | sequences.texi cyd |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 51eed431ca2..7f11c65f9e1 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-03-05 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * positions.texi (Text Lines): Document count-words. | ||
| 4 | |||
| 1 | 2012-03-04 Chong Yidong <cyd@gnu.org> | 5 | 2012-03-04 Chong Yidong <cyd@gnu.org> |
| 2 | 6 | ||
| 3 | * frames.texi (Frames): Remove little-used "terminal frame" and | 7 | * frames.texi (Frames): Remove little-used "terminal frame" and |
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 29b338369e5..99722c93902 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -372,18 +372,17 @@ This function returns the number of lines between the positions | |||
| 372 | 1, even if @var{start} and @var{end} are on the same line. This is | 372 | 1, even if @var{start} and @var{end} are on the same line. This is |
| 373 | because the text between them, considered in isolation, must contain at | 373 | because the text between them, considered in isolation, must contain at |
| 374 | least one line unless it is empty. | 374 | least one line unless it is empty. |
| 375 | @end defun | ||
| 375 | 376 | ||
| 376 | Here is an example of using @code{count-lines}: | 377 | @deffn Command count-words start end |
| 378 | @cindex words in region | ||
| 379 | This function returns the number of words between the positions | ||
| 380 | @var{start} and @var{end} in the current buffer. | ||
| 377 | 381 | ||
| 378 | @example | 382 | This function can also be called interactively. In that case, it |
| 379 | @group | 383 | prints a message reporting the number of lines, words, and characters |
| 380 | (defun current-line () | 384 | in the buffer, or in the region if the region is active. |
| 381 | "Return the vertical position of point@dots{}" | 385 | @end deffn |
| 382 | (+ (count-lines (window-start) (point)) | ||
| 383 | (if (= (current-column) 0) 1 0))) | ||
| 384 | @end group | ||
| 385 | @end example | ||
| 386 | @end defun | ||
| 387 | 386 | ||
| 388 | @defun line-number-at-pos &optional pos | 387 | @defun line-number-at-pos &optional pos |
| 389 | @cindex line number | 388 | @cindex line number |