summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1994-10-08 22:12:45 +0000
committerJim Blandy <jimb@redhat.com>1994-10-08 22:12:45 +0000
commite90b1a7dad6dd7834eee413b867102322d5b34a1 (patch)
tree2ea6abde5abf1ffc0eefeb201bc654d952c7b5c6 /src/buffer.h
parent2bb45f1804319709e15e07a45c33e3ddb2a0b986 (diff)
downloademacs-e90b1a7dad6dd7834eee413b867102322d5b34a1.tar.gz
* buffer.h (struct buffer): New members: newline_cache,
width_run_cache, width_table, and cache_long_line_scans.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 27dabaa0ac2..4e2a6495886 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -200,6 +200,24 @@ struct buffer
buffer */
Lisp_Object markers;
+ /* If the long line scan cache is enabled (i.e. the buffer-local
+ variable cache-long-line-scans is non-nil), newline_cache
+ points to the newline cache, and width_run_cache points to the
+ width run cache.
+
+ The newline cache records which stretches of the buffer are
+ known *not* to contain newlines, so that they can be skipped
+ quickly when we search for newlines.
+
+ The width run cache records which stretches of the buffer are
+ known to contain characters whose widths are all the same. If
+ the width run cache maps a character to a value > 0, that value is
+ the character's width; if it maps a character to zero, we don't
+ know what its width is. This allows compute_motion to process
+ such regions very quickly, using algebra instead of inspecting
+ each character. See also width_table, below. */
+ struct region_cache *newline_cache;
+ struct region_cache *width_run_cache;
/* Everything from here down must be a Lisp_Object */
@@ -304,6 +322,18 @@ struct buffer
/* Position where the overlay lists are centered. */
Lisp_Object overlay_center;
+
+ /* True if the newline position cache and width run cache are
+ enabled. See search.c and indent.c. */
+ Lisp_Object cache_long_line_scans;
+
+ /* If the width run cache is enabled, this table contains the
+ character widths width_run_cache (see above) assumes. When we
+ do a thorough redisplay, we compare this against the buffer's
+ current display table to see whether the display table has
+ affected the widths of any characters. If it has, we
+ invalidate the width run cache, and re-initialize width_table. */
+ Lisp_Object width_table;
};
/* This points to the current buffer. */