aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1994-10-08 22:12:45 +0000
committerJim Blandy1994-10-08 22:12:45 +0000
commit18e9375535db94d010d96d5f3b3dadf1c131f1be (patch)
tree81a4d44b2c5765d5420c963fb5c65160858b3510 /src
parent28e969dd70e4827e55cb8464a413332ec70af166 (diff)
downloademacs-18e9375535db94d010d96d5f3b3dadf1c131f1be.tar.gz
emacs-18e9375535db94d010d96d5f3b3dadf1c131f1be.zip
* buffer.h (struct buffer): New members: newline_cache,
width_run_cache, width_table, and cache_long_line_scans.
Diffstat (limited to 'src')
-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
200 buffer */ 200 buffer */
201 Lisp_Object markers; 201 Lisp_Object markers;
202 202
203 /* If the long line scan cache is enabled (i.e. the buffer-local
204 variable cache-long-line-scans is non-nil), newline_cache
205 points to the newline cache, and width_run_cache points to the
206 width run cache.
207
208 The newline cache records which stretches of the buffer are
209 known *not* to contain newlines, so that they can be skipped
210 quickly when we search for newlines.
211
212 The width run cache records which stretches of the buffer are
213 known to contain characters whose widths are all the same. If
214 the width run cache maps a character to a value > 0, that value is
215 the character's width; if it maps a character to zero, we don't
216 know what its width is. This allows compute_motion to process
217 such regions very quickly, using algebra instead of inspecting
218 each character. See also width_table, below. */
219 struct region_cache *newline_cache;
220 struct region_cache *width_run_cache;
203 221
204 /* Everything from here down must be a Lisp_Object */ 222 /* Everything from here down must be a Lisp_Object */
205 223
@@ -304,6 +322,18 @@ struct buffer
304 322
305 /* Position where the overlay lists are centered. */ 323 /* Position where the overlay lists are centered. */
306 Lisp_Object overlay_center; 324 Lisp_Object overlay_center;
325
326 /* True if the newline position cache and width run cache are
327 enabled. See search.c and indent.c. */
328 Lisp_Object cache_long_line_scans;
329
330 /* If the width run cache is enabled, this table contains the
331 character widths width_run_cache (see above) assumes. When we
332 do a thorough redisplay, we compare this against the buffer's
333 current display table to see whether the display table has
334 affected the widths of any characters. If it has, we
335 invalidate the width run cache, and re-initialize width_table. */
336 Lisp_Object width_table;
307}; 337};
308 338
309/* This points to the current buffer. */ 339/* This points to the current buffer. */