comparison src/xdisp.c @ 90813:e6fdae9180d4

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 698-710) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 216) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-196
author Miles Bader <miles@gnu.org>
date Tue, 24 Apr 2007 21:56:25 +0000
parents 4ef881a120fe 6423e582c81d
children 70bf32a0f523
comparison
equal deleted inserted replaced
90812:6137cc8ddf90 90813:e6fdae9180d4
12924 int temp_scroll_step = 0; 12924 int temp_scroll_step = 0;
12925 int count = SPECPDL_INDEX (); 12925 int count = SPECPDL_INDEX ();
12926 int rc; 12926 int rc;
12927 int centering_position = -1; 12927 int centering_position = -1;
12928 int last_line_misfit = 0; 12928 int last_line_misfit = 0;
12929 int save_beg_unchanged, save_end_unchanged;
12929 12930
12930 SET_TEXT_POS (lpoint, PT, PT_BYTE); 12931 SET_TEXT_POS (lpoint, PT, PT_BYTE);
12931 opoint = lpoint; 12932 opoint = lpoint;
12932 12933
12933 /* W must be a leaf window here. */ 12934 /* W must be a leaf window here. */
12987 value. */ 12988 value. */
12988 /* Really select the buffer, for the sake of buffer-local 12989 /* Really select the buffer, for the sake of buffer-local
12989 variables. */ 12990 variables. */
12990 set_buffer_internal_1 (XBUFFER (w->buffer)); 12991 set_buffer_internal_1 (XBUFFER (w->buffer));
12991 SET_TEXT_POS (opoint, PT, PT_BYTE); 12992 SET_TEXT_POS (opoint, PT, PT_BYTE);
12993
12994 save_beg_unchanged = BEG_UNCHANGED;
12995 save_end_unchanged = END_UNCHANGED;
12992 12996
12993 current_matrix_up_to_date_p 12997 current_matrix_up_to_date_p
12994 = (!NILP (w->window_end_valid) 12998 = (!NILP (w->window_end_valid)
12995 && !current_buffer->clip_changed 12999 && !current_buffer->clip_changed
12996 && !current_buffer->prevent_redisplay_optimizations_p 13000 && !current_buffer->prevent_redisplay_optimizations_p
13292 than a simple mouse-click. */ 13296 than a simple mouse-click. */
13293 if (NILP (w->start_at_line_beg) 13297 if (NILP (w->start_at_line_beg)
13294 && NILP (do_mouse_tracking) 13298 && NILP (do_mouse_tracking)
13295 && CHARPOS (startp) > BEGV) 13299 && CHARPOS (startp) > BEGV)
13296 { 13300 {
13297 /* Make sure beg_unchanged and end_unchanged are up to date. 13301 #if 0
13298 Do it only if buffer has really changed. This may or may 13302 /* The following code tried to make BEG_UNCHANGED and
13299 not have been done by try_window_id (see which) already. */ 13303 END_UNCHANGED up to date (similar to try_window_id).
13304 Is it important to do so?
13305
13306 The trouble is that it's a little too strict when it
13307 comes to overlays: modify_overlay can call
13308 BUF_COMPUTE_UNCHANGED, which alters BUF_BEG_UNCHANGED and
13309 BUF_END_UNCHANGED directly without moving the gap.
13310
13311 This can result in spurious recentering when overlays are
13312 altered in the buffer. So unless it's proven necessary,
13313 let's leave this commented out for now. -- cyd. */
13300 if (MODIFF > SAVE_MODIFF 13314 if (MODIFF > SAVE_MODIFF
13301 /* This seems to happen sometimes after saving a buffer. */
13302 || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) 13315 || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE)
13303 { 13316 {
13304 if (GPT - BEG < BEG_UNCHANGED) 13317 if (GPT - BEG < BEG_UNCHANGED)
13305 BEG_UNCHANGED = GPT - BEG; 13318 BEG_UNCHANGED = GPT - BEG;
13306 if (Z - GPT < END_UNCHANGED) 13319 if (Z - GPT < END_UNCHANGED)
13307 END_UNCHANGED = Z - GPT; 13320 END_UNCHANGED = Z - GPT;
13308 } 13321 }
13309 13322 #endif
13310 if (CHARPOS (startp) > BEG + BEG_UNCHANGED 13323
13311 && CHARPOS (startp) <= Z - END_UNCHANGED) 13324 if (CHARPOS (startp) > BEG + save_beg_unchanged
13325 && CHARPOS (startp) <= Z - save_end_unchanged)
13312 { 13326 {
13313 /* There doesn't seems to be a simple way to find a new 13327 /* There doesn't seems to be a simple way to find a new
13314 window start that is near the old window start, so 13328 window start that is near the old window start, so
13315 we just recenter. */ 13329 we just recenter. */
13316 goto recenter; 13330 goto recenter;
16000 { 16014 {
16001 int cursor_row_p = 1; 16015 int cursor_row_p = 1;
16002 16016
16003 if (PT == MATRIX_ROW_END_CHARPOS (row)) 16017 if (PT == MATRIX_ROW_END_CHARPOS (row))
16004 { 16018 {
16005 /* If the row ends with a newline from a string, we don't want 16019 /* Suppose the row ends on a string.
16006 the cursor there, but we still want it at the start of the 16020 Unless the row is continued, that means it ends on a newline
16007 string if the string starts in this row. 16021 in the string. If it's anything other than a display string
16008 If the row is continued it doesn't end in a newline. */ 16022 (e.g. a before-string from an overlay), we don't want the
16023 cursor there. (This heuristic seems to give the optimal
16024 behavior for the various types of multi-line strings.) */
16009 if (CHARPOS (row->end.string_pos) >= 0) 16025 if (CHARPOS (row->end.string_pos) >= 0)
16010 cursor_row_p = (row->continued_p 16026 {
16011 || PT >= MATRIX_ROW_START_CHARPOS (row)); 16027 if (row->continued_p)
16028 cursor_row_p = 1;
16029 else
16030 {
16031 /* Check for `display' property. */
16032 struct glyph *beg = row->glyphs[TEXT_AREA];
16033 struct glyph *end = beg + row->used[TEXT_AREA] - 1;
16034 struct glyph *glyph;
16035
16036 cursor_row_p = 0;
16037 for (glyph = end; glyph >= beg; --glyph)
16038 if (STRINGP (glyph->object))
16039 {
16040 Lisp_Object prop
16041 = Fget_char_property (make_number (PT),
16042 Qdisplay, Qnil);
16043 cursor_row_p =
16044 (!NILP (prop)
16045 && display_prop_string_p (prop, glyph->object));
16046 break;
16047 }
16048 }
16049 }
16012 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) 16050 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
16013 { 16051 {
16014 /* If the row ends in middle of a real character, 16052 /* If the row ends in middle of a real character,
16015 and the line is continued, we want the cursor here. 16053 and the line is continued, we want the cursor here.
16016 That's because MATRIX_ROW_END_CHARPOS would equal 16054 That's because MATRIX_ROW_END_CHARPOS would equal