aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-09-06 19:49:21 +0000
committerRichard M. Stallman2001-09-06 19:49:21 +0000
commitf4f65a420cbc948c05a7cddc500d546124228b64 (patch)
tree8b3b5b7ecfddbdfb9de1d424c69ab75cd2a8619c
parenta5d0a32e01523b1fd906bc36b62e2e3437e5f8cc (diff)
downloademacs-f4f65a420cbc948c05a7cddc500d546124228b64.tar.gz
emacs-f4f65a420cbc948c05a7cddc500d546124228b64.zip
Rewrite and move definition of count-screen-lines.
Minor clarifications.
-rw-r--r--lispref/positions.texi42
1 files changed, 22 insertions, 20 deletions
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 5e9abd359c6..2f2462c84ff 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -190,7 +190,7 @@ This function moves point forward @var{count} words (or backward if
190@var{count} is negative). ``Moving one word'' means moving until point 190@var{count} is negative). ``Moving one word'' means moving until point
191crosses a word-constituent character and then encounters a 191crosses a word-constituent character and then encounters a
192word-separator character. However, this function cannot move point past 192word-separator character. However, this function cannot move point past
193the boundary of the accessible part of the buffer, or across a field 193the boundary of the accessible portion of the buffer, or across a field
194boundary (@pxref{Fields}). The most common case of a field boundary is 194boundary (@pxref{Fields}). The most common case of a field boundary is
195the end of the prompt in the minibuffer. 195the end of the prompt in the minibuffer.
196 196
@@ -491,7 +491,6 @@ thus take time proportional to the distance scanned. If you intend to
491use them heavily, Emacs provides caches which may improve the 491use them heavily, Emacs provides caches which may improve the
492performance of your code. @xref{Truncation, cache-long-line-scans}. 492performance of your code. @xref{Truncation, cache-long-line-scans}.
493 493
494
495@defun vertical-motion count &optional window 494@defun vertical-motion count &optional window
496This function moves point to the start of the screen line @var{count} 495This function moves point to the start of the screen line @var{count}
497screen lines down from the screen line containing point. If @var{count} 496screen lines down from the screen line containing point. If @var{count}
@@ -507,6 +506,27 @@ width, the horizontal scrolling, and the display table. But
507@var{window} currently displays some other buffer. 506@var{window} currently displays some other buffer.
508@end defun 507@end defun
509 508
509@defun count-screen-lines &optional beg end count-final-newline window
510This function returns the number of screen lines in the text from
511@var{beg} to @var{end}. The number of screen lines may be different
512from the number of actual lines, due to line continuation, the display
513table, etc. If @var{beg} and @var{end} are @code{nil} or omitted,
514they default to the beginning and end of the accessible portion of the
515buffer.
516
517If the region ends with a newline, that is ignored unless the optional
518third argument @var{count-final-newline} is non-@code{nil}.
519
520The optional fourth argument @var{window} specifies the window for
521obtaining parameters such as width, horizontal scrolling, and so on.
522The default is to use the selected window's parameters.
523
524Like @code{vertical-motion}, @code{count-screen-lines} always uses the
525current buffer, regardless of which buffer is displayed in
526@var{window}. This makes possible to use @code{count-screen-lines} in
527any buffer, whether or not it is currently displayed in some window.
528@end defun
529
510@deffn Command move-to-window-line count 530@deffn Command move-to-window-line count
511This function moves point with respect to the text currently displayed 531This function moves point with respect to the text currently displayed
512in the selected window. It moves point to the beginning of the screen 532in the selected window. It moves point to the beginning of the screen
@@ -528,24 +548,6 @@ The value returned is the window line number point has moved to, with
528the top line in the window numbered 0. 548the top line in the window numbered 0.
529@end deffn 549@end deffn
530 550
531@defun count-screen-lines &optional beg end count-final-newline window
532This function returns the number of the screen lines occupied by the
533text between positions @var{beg} and @var{end}. These arguments default
534to the beginning and end of the accessible portion of the buffer.
535
536If region ends with a newline, it is significant if
537@var{count-final-newline} is non-@code{nil}. Otherwise it is ignored.
538
539The argument @var{window} specifies the window used for obtaining
540parameters such as width, horizontal scrolling, and so on. The default
541is the selected window.
542
543Like @code{vertical-motion}, @code{count-screen-lines} always uses the
544current buffer, regardless of which buffer is displayed in @var{window}.
545This makes possible to use @code{count-screen-lines} in any buffer,
546whether or not it is currently displayed in some window.
547@end defun
548
549@defun compute-motion from frompos to topos width offsets window 551@defun compute-motion from frompos to topos width offsets window
550This function scans the current buffer, calculating screen positions. 552This function scans the current buffer, calculating screen positions.
551It scans the buffer forward from position @var{from}, assuming that is 553It scans the buffer forward from position @var{from}, assuming that is