aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-06 10:53:09 +0400
committerDmitry Antipov2013-08-06 10:53:09 +0400
commite30b79c1c52a4428189ca148c73e7ecc993c6f6a (patch)
treea7f60977d16877bbe0f626429243ea19543ed84e /src/buffer.h
parent00012b86257f33dd4e08e79b814f4a7ad6010713 (diff)
downloademacs-e30b79c1c52a4428189ca148c73e7ecc993c6f6a.tar.gz
emacs-e30b79c1c52a4428189ca148c73e7ecc993c6f6a.zip
Use region cache to speedup bidi_find_paragraph_start.
* src/buffer.h (struct buffer): New member bidi_paragraph_cache. Rename cache_long_line_scans to cache_long_scans. * src/buffer.c (bset_cache_long_line_scans): Rename to bset_cache_long_scans. (Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer) (Fbuffer_swap_text, init_buffer_once): Take bidi_paragraph_cache into account. (syms_of_buffer): Rename cache-long-line-scans to cache-long-scans. Adjust docstring. * src/search.c (newline_cache_on_off): * src/indent.c (width_run_cache_on_off): Adjust users. * src/bidi.c (bidi_paragraph_cache_on_off): New function. (bidi_find_paragraph_start): Use bidi_paragraph_cache if needed. * src/insdel.c (prepare_to_modify_buffer): Invalidate bidi_paragraph_cache if enabled. * doc/lispref/positions.texi (Motion by Screen Lines): * doc/lispref/display.texi (Truncation): Rename `cache-long-line-scans' to `cache-long-scans'.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 646f8f72232..221db39329a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -632,9 +632,9 @@ struct buffer
632 /* List of symbols naming the file format used for auto-save file. */ 632 /* List of symbols naming the file format used for auto-save file. */
633 Lisp_Object INTERNAL_FIELD (auto_save_file_format); 633 Lisp_Object INTERNAL_FIELD (auto_save_file_format);
634 634
635 /* True if the newline position cache and width run cache are 635 /* True if the newline position cache, width run cache and BIDI paragraph
636 enabled. See search.c and indent.c. */ 636 cache are enabled. See search.c, indent.c and bidi.c for details. */
637 Lisp_Object INTERNAL_FIELD (cache_long_line_scans); 637 Lisp_Object INTERNAL_FIELD (cache_long_scans);
638 638
639 /* If the width run cache is enabled, this table contains the 639 /* If the width run cache is enabled, this table contains the
640 character widths width_run_cache (see above) assumes. When we 640 character widths width_run_cache (see above) assumes. When we
@@ -839,9 +839,12 @@ struct buffer
839 the character's width; if it maps a character to zero, we don't 839 the character's width; if it maps a character to zero, we don't
840 know what its width is. This allows compute_motion to process 840 know what its width is. This allows compute_motion to process
841 such regions very quickly, using algebra instead of inspecting 841 such regions very quickly, using algebra instead of inspecting
842 each character. See also width_table, below. */ 842 each character. See also width_table, below.
843
844 The latter cache is used to speedup bidi_find_paragraph_start. */
843 struct region_cache *newline_cache; 845 struct region_cache *newline_cache;
844 struct region_cache *width_run_cache; 846 struct region_cache *width_run_cache;
847 struct region_cache *bidi_paragraph_cache;
845 848
846 /* Non-zero means don't use redisplay optimizations for 849 /* Non-zero means don't use redisplay optimizations for
847 displaying this buffer. */ 850 displaying this buffer. */