aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1994-10-08 22:09:57 +0000
committerJim Blandy1994-10-08 22:09:57 +0000
commit788583a16b73f27743113c8f15bad4db4ea9b79e (patch)
tree25ba1f24a67f177e92cd48305b84a3388108cd49
parent4a40123fc0645b5c6d39441b9c3e2b5a1edb0933 (diff)
downloademacs-788583a16b73f27743113c8f15bad4db4ea9b79e.tar.gz
emacs-788583a16b73f27743113c8f15bad4db4ea9b79e.zip
Document cache-long-line-scans in @node Text Lines.
Cross-reference it in @node Screen Lines.
-rw-r--r--lispref/positions.texi36
1 files changed, 36 insertions, 0 deletions
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 28ff5ca4e04..6691a63c827 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -422,6 +422,36 @@ to use and more reliable (no dependence on goal column, etc.).
422@c ================ 422@c ================
423@end ignore 423@end ignore
424 424
425@defvar cache-long-line-scans
426This variable determines whether Emacs should use caches to handle long
427lines more quickly. This variable is buffer-local, in all buffers.
428
429 Normally, the line-motion functions work by scanning the buffer for
430newlines. Columnar operations (like @code{move-to-column} and
431@code{compute-motion}) also work by scanning the buffer, summing
432character widths as they go. This works well for ordinary text, but if
433the buffer's lines are very long (say, more than 500 characters), these
434motion functions will take longer to execute. Emacs may also take
435longer to update the display.
436
437 If @code{cache-long-line-scans} is non-@code{nil}, these motion
438functions cache the results of their scans, and consult the cache to
439avoid rescanning regions of the buffer until the text is modified. The
440caches are most beneficial when they prevent the most searching---that
441is, when the buffer contains long lines and large regions of characters
442with the same, fixed screen width.
443
444 When @code{cache-long-line-scans} is non-@code{nil}, processing short
445lines will become slightly slower (because of the overhead of consulting
446the cache), and the caches will use memory roughly proportional to the
447number of newlines and characters whose screen width varies.
448
449 The caches require no explicit maintenance; their accuracy is
450maintained internally by the Emacs primitives. Enabling or disabling
451the cache should not affect the behavior of any of the motion functions;
452it should only affect their performance.
453@end defvar
454
425 Also see the functions @code{bolp} and @code{eolp} in @ref{Near Point}. 455 Also see the functions @code{bolp} and @code{eolp} in @ref{Near Point}.
426These functions do not move point, but test whether it is already at the 456These functions do not move point, but test whether it is already at the
427beginning or end of a line. 457beginning or end of a line.
@@ -448,6 +478,12 @@ in, and even on the selected window (because the width, the truncation
448flag, and display table may vary between windows). @xref{Usual 478flag, and display table may vary between windows). @xref{Usual
449Display}. 479Display}.
450 480
481 These functions scan text to determine where screen lines break, and
482thus take time proportional to the distance scanned. If you intend to
483use them heavily, Emacs provides caches which may improve the
484performance of your code. @xref{Text Lines, cache-long-line-scans}.
485
486
451@defun vertical-motion count &optional window 487@defun vertical-motion count &optional window
452This function moves point to the start of the screen line @var{count} 488This function moves point to the start of the screen line @var{count}
453screen lines down from the screen line containing point. If @var{count} 489screen lines down from the screen line containing point. If @var{count}