diff options
| author | Jim Blandy | 1994-10-08 22:09:57 +0000 |
|---|---|---|
| committer | Jim Blandy | 1994-10-08 22:09:57 +0000 |
| commit | 788583a16b73f27743113c8f15bad4db4ea9b79e (patch) | |
| tree | 25ba1f24a67f177e92cd48305b84a3388108cd49 | |
| parent | 4a40123fc0645b5c6d39441b9c3e2b5a1edb0933 (diff) | |
| download | emacs-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.texi | 36 |
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 | ||
| 426 | This variable determines whether Emacs should use caches to handle long | ||
| 427 | lines more quickly. This variable is buffer-local, in all buffers. | ||
| 428 | |||
| 429 | Normally, the line-motion functions work by scanning the buffer for | ||
| 430 | newlines. Columnar operations (like @code{move-to-column} and | ||
| 431 | @code{compute-motion}) also work by scanning the buffer, summing | ||
| 432 | character widths as they go. This works well for ordinary text, but if | ||
| 433 | the buffer's lines are very long (say, more than 500 characters), these | ||
| 434 | motion functions will take longer to execute. Emacs may also take | ||
| 435 | longer to update the display. | ||
| 436 | |||
| 437 | If @code{cache-long-line-scans} is non-@code{nil}, these motion | ||
| 438 | functions cache the results of their scans, and consult the cache to | ||
| 439 | avoid rescanning regions of the buffer until the text is modified. The | ||
| 440 | caches are most beneficial when they prevent the most searching---that | ||
| 441 | is, when the buffer contains long lines and large regions of characters | ||
| 442 | with the same, fixed screen width. | ||
| 443 | |||
| 444 | When @code{cache-long-line-scans} is non-@code{nil}, processing short | ||
| 445 | lines will become slightly slower (because of the overhead of consulting | ||
| 446 | the cache), and the caches will use memory roughly proportional to the | ||
| 447 | number of newlines and characters whose screen width varies. | ||
| 448 | |||
| 449 | The caches require no explicit maintenance; their accuracy is | ||
| 450 | maintained internally by the Emacs primitives. Enabling or disabling | ||
| 451 | the cache should not affect the behavior of any of the motion functions; | ||
| 452 | it 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}. |
| 426 | These functions do not move point, but test whether it is already at the | 456 | These functions do not move point, but test whether it is already at the |
| 427 | beginning or end of a line. | 457 | beginning or end of a line. |
| @@ -448,6 +478,12 @@ in, and even on the selected window (because the width, the truncation | |||
| 448 | flag, and display table may vary between windows). @xref{Usual | 478 | flag, and display table may vary between windows). @xref{Usual |
| 449 | Display}. | 479 | Display}. |
| 450 | 480 | ||
| 481 | These functions scan text to determine where screen lines break, and | ||
| 482 | thus take time proportional to the distance scanned. If you intend to | ||
| 483 | use them heavily, Emacs provides caches which may improve the | ||
| 484 | performance 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 |
| 452 | This function moves point to the start of the screen line @var{count} | 488 | This function moves point to the start of the screen line @var{count} |
| 453 | screen lines down from the screen line containing point. If @var{count} | 489 | screen lines down from the screen line containing point. If @var{count} |