aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xdisp.c12
2 files changed, 15 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 883c0d84bf6..dc81626038d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,13 @@
12011-07-24 Paul Eggert <eggert@cs.ucla.edu> 12011-07-25 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * Makefile.in (gl-stamp): move-if-change is now in build-aux. 3 * Makefile.in (gl-stamp): move-if-change is now in build-aux.
4 4
52011-07-25 Eli Zaretskii <eliz@gnu.org>
6
7 * xdisp.c (compute_display_string_pos): Fix logic of caching
8 previous display string position. Initialize cached_prev_pos to
9 -1. Fixes slow-down at the beginning of a buffer.
10
52011-07-24 Eli Zaretskii <eliz@gnu.org> 112011-07-24 Eli Zaretskii <eliz@gnu.org>
6 12
7 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil' 13 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
diff --git a/src/xdisp.c b/src/xdisp.c
index 8b164008c3f..7493fbff008 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3137,7 +3137,7 @@ next_overlay_change (EMACS_INT pos)
3137/* Record one cached display string position found recently by 3137/* Record one cached display string position found recently by
3138 compute_display_string_pos. */ 3138 compute_display_string_pos. */
3139static EMACS_INT cached_disp_pos; 3139static EMACS_INT cached_disp_pos;
3140static EMACS_INT cached_prev_pos; 3140static EMACS_INT cached_prev_pos = -1;
3141static struct buffer *cached_disp_buffer; 3141static struct buffer *cached_disp_buffer;
3142static int cached_disp_modiff; 3142static int cached_disp_modiff;
3143static int cached_disp_overlay_modiff; 3143static int cached_disp_overlay_modiff;
@@ -3184,18 +3184,22 @@ compute_display_string_pos (struct text_pos *position,
3184 && BUF_MODIFF (b) == cached_disp_modiff 3184 && BUF_MODIFF (b) == cached_disp_modiff
3185 && BUF_OVERLAY_MODIFF (b) == cached_disp_overlay_modiff) 3185 && BUF_OVERLAY_MODIFF (b) == cached_disp_overlay_modiff)
3186 { 3186 {
3187 if (cached_prev_pos 3187 if (cached_prev_pos >= 0
3188 && cached_prev_pos < charpos && charpos <= cached_disp_pos) 3188 && cached_prev_pos < charpos && charpos <= cached_disp_pos)
3189 return cached_disp_pos; 3189 return cached_disp_pos;
3190 /* Handle overstepping either end of the known interval. */ 3190 /* Handle overstepping either end of the known interval. */
3191 if (charpos > cached_disp_pos) 3191 if (charpos > cached_disp_pos)
3192 cached_prev_pos = cached_disp_pos; 3192 cached_prev_pos = cached_disp_pos;
3193 else /* charpos <= cached_prev_pos */ 3193 else /* charpos <= cached_prev_pos */
3194 cached_prev_pos = max (charpos - 1, BEGV); 3194 cached_prev_pos = max (charpos - 1, 0);
3195 } 3195 }
3196 3196
3197 /* Record new values in the cache. */ 3197 /* Record new values in the cache. */
3198 cached_disp_buffer = b; 3198 if (b != cached_disp_buffer)
3199 {
3200 cached_disp_buffer = b;
3201 cached_prev_pos = max (charpos - 1, 0);
3202 }
3199 cached_disp_modiff = BUF_MODIFF (b); 3203 cached_disp_modiff = BUF_MODIFF (b);
3200 cached_disp_overlay_modiff = BUF_OVERLAY_MODIFF (b); 3204 cached_disp_overlay_modiff = BUF_OVERLAY_MODIFF (b);
3201 } 3205 }