aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-03-05 14:12:17 +0800
committerChong Yidong2012-03-05 14:12:17 +0800
commitef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86 (patch)
tree9c6a51a3174b84e0e2991ec26278ea33818bc3f6
parent10607bea34d2cddc62761df6c88d674c2861e71d (diff)
downloademacs-ef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86.tar.gz
emacs-ef959d3a0cb5cbb5a4ea2b0d6e6e50cb4356cb86.zip
* doc/lispref/positions.texi (Text Lines): Document count-words.
-rw-r--r--admin/FOR-RELEASE2
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/positions.texi19
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
219objects.texi cyd 219objects.texi cyd
220os.texi 220os.texi
221package.texi 221package.texi
222positions.texi 222positions.texi cyd
223processes.texi 223processes.texi
224searching.texi 224searching.texi
225sequences.texi cyd 225sequences.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 @@
12012-03-05 Chong Yidong <cyd@gnu.org>
2
3 * positions.texi (Text Lines): Document count-words.
4
12012-03-04 Chong Yidong <cyd@gnu.org> 52012-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
3721, even if @var{start} and @var{end} are on the same line. This is 3721, even if @var{start} and @var{end} are on the same line. This is
373because the text between them, considered in isolation, must contain at 373because the text between them, considered in isolation, must contain at
374least one line unless it is empty. 374least one line unless it is empty.
375@end defun
375 376
376Here is an example of using @code{count-lines}: 377@deffn Command count-words start end
378@cindex words in region
379This function returns the number of words between the positions
380@var{start} and @var{end} in the current buffer.
377 381
378@example 382This function can also be called interactively. In that case, it
379@group 383prints a message reporting the number of lines, words, and characters
380(defun current-line () 384in 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