From 55439c615b8e04748a66a6d88ec70a9ac5acd672 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 2 Aug 2011 22:16:32 +0300 Subject: Fix bug #9218 with slow cursor motion and scrolling Org Mode buffers. src/dispextern.h (struct bidi_it): New member disp_prop_p. src/xdisp.c: Remove one-slot cache of display string positions. (compute_display_string_pos): Accept an additional argument DISP_PROP_P; callers changed. Scan at most 5K characters forward for a display string or property. If found, set DISP_PROP_P non-zero. src/bidi.c (bidi_fetch_char): Accept an additional argument DISP_PROP_P, and pass it to compute_display_string_pos. Only handle text covered by a display string if DISP_PROP_P is returned non-zero. All callers of bidi_fetch_char changed. --- src/dispextern.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/dispextern.h') diff --git a/src/dispextern.h b/src/dispextern.h index dc44c69816..2e245479a8 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1868,6 +1868,8 @@ struct bidi_it { bidi_dir_t paragraph_dir; /* current paragraph direction */ EMACS_INT separator_limit; /* where paragraph separator should end */ EMACS_INT disp_pos; /* position of display string after ch */ + int disp_prop_p; /* if non-zero, there really is a + `display' property/string at disp_pos */ unsigned first_elt : 1; /* if non-zero, examine current char first */ unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */ unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */ @@ -3035,7 +3037,8 @@ extern Lisp_Object lookup_glyphless_char_display (int, struct it *); extern int calc_pixel_width_or_height (double *, struct it *, Lisp_Object, struct font *, int, int *); extern EMACS_INT compute_display_string_pos (struct text_pos *, - struct bidi_string_data *, int); + struct bidi_string_data *, + int, int *); extern EMACS_INT compute_display_string_end (EMACS_INT, struct bidi_string_data *); -- cgit v1.2.3