aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-03-05 23:50:01 -0800
committerPaul Eggert2011-03-05 23:50:01 -0800
commit5489860be109ec6fa2a7d143cdecb6887e37f5d5 (patch)
treeb15cef9e711d27ae9bbcfb726b64e6a78eda1bd7
parent257219bd2eeebc6590fc075e74903c1d4cc43414 (diff)
downloademacs-5489860be109ec6fa2a7d143cdecb6887e37f5d5.tar.gz
emacs-5489860be109ec6fa2a7d143cdecb6887e37f5d5.zip
* xdisp.c: Rename or move local decls to avoid shadowing.
(init_iterator, handle_fontified_prop, handle_single_display_spec): (message_dolog, message_with_string, redisplay_internal): (redisplay_window, try_window_reusing_current_matrix, try_window_id): (compute_line_metrics, highlight_trailing_whitespace, cursor_row_p): (display_line, display_string, rows_from_pos_range): (mouse_face_from_buffer_pos, note_mouse_highlight, expose_frame): Rename or move local decls.
-rw-r--r--src/ChangeLog11
-rw-r--r--src/xdisp.c265
2 files changed, 146 insertions, 130 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 34e28866144..29514f03177 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12011-03-06 Paul Eggert <eggert@cs.ucla.edu>
2
3 * xdisp.c: Rename or move local decls to avoid shadowing.
4 (init_iterator, handle_fontified_prop, handle_single_display_spec):
5 (message_dolog, message_with_string, redisplay_internal):
6 (redisplay_window, try_window_reusing_current_matrix, try_window_id):
7 (compute_line_metrics, highlight_trailing_whitespace, cursor_row_p):
8 (display_line, display_string, rows_from_pos_range):
9 (mouse_face_from_buffer_pos, note_mouse_highlight, expose_frame):
10 Rename or move local decls.
11
12011-03-02 Paul Eggert <eggert@cs.ucla.edu> 122011-03-02 Paul Eggert <eggert@cs.ucla.edu>
2 13
3 Work around some portability problems with symlinks. 14 Work around some portability problems with symlinks.
diff --git a/src/xdisp.c b/src/xdisp.c
index 35f4859f1b3..d2ffcddb985 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2477,9 +2477,9 @@ init_iterator (struct it *it, struct window *w,
2477 && WINDOWP (minibuf_selected_window) 2477 && WINDOWP (minibuf_selected_window)
2478 && w == XWINDOW (minibuf_selected_window)))) 2478 && w == XWINDOW (minibuf_selected_window))))
2479 { 2479 {
2480 EMACS_INT charpos = marker_position (BVAR (current_buffer, mark)); 2480 EMACS_INT markpos = marker_position (BVAR (current_buffer, mark));
2481 it->region_beg_charpos = min (PT, charpos); 2481 it->region_beg_charpos = min (PT, markpos);
2482 it->region_end_charpos = max (PT, charpos); 2482 it->region_end_charpos = max (PT, markpos);
2483 } 2483 }
2484 else 2484 else
2485 it->region_beg_charpos = it->region_end_charpos = -1; 2485 it->region_beg_charpos = it->region_end_charpos = -1;
@@ -3183,11 +3183,11 @@ handle_fontified_prop (struct it *it)
3183 safe_call1 (val, pos); 3183 safe_call1 (val, pos);
3184 else 3184 else
3185 { 3185 {
3186 Lisp_Object globals, fn; 3186 Lisp_Object fns, fn;
3187 struct gcpro gcpro1, gcpro2; 3187 struct gcpro gcpro1, gcpro2;
3188 3188
3189 globals = Qnil; 3189 fns = Qnil;
3190 GCPRO2 (val, globals); 3190 GCPRO2 (val, fns);
3191 3191
3192 for (; CONSP (val); val = XCDR (val)) 3192 for (; CONSP (val); val = XCDR (val))
3193 { 3193 {
@@ -3200,11 +3200,11 @@ handle_fontified_prop (struct it *it)
3200 In a global value, t should not occur. If it 3200 In a global value, t should not occur. If it
3201 does, we must ignore it to avoid an endless 3201 does, we must ignore it to avoid an endless
3202 loop. */ 3202 loop. */
3203 for (globals = Fdefault_value (Qfontification_functions); 3203 for (fns = Fdefault_value (Qfontification_functions);
3204 CONSP (globals); 3204 CONSP (fns);
3205 globals = XCDR (globals)) 3205 fns = XCDR (fns))
3206 { 3206 {
3207 fn = XCAR (globals); 3207 fn = XCAR (fns);
3208 if (!EQ (fn, Qt)) 3208 if (!EQ (fn, Qt))
3209 safe_call1 (fn, pos); 3209 safe_call1 (fn, pos);
3210 } 3210 }
@@ -3989,12 +3989,12 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
3989 else if (NUMBERP (it->font_height)) 3989 else if (NUMBERP (it->font_height))
3990 { 3990 {
3991 /* Value is a multiple of the canonical char height. */ 3991 /* Value is a multiple of the canonical char height. */
3992 struct face *face; 3992 struct face *f;
3993 3993
3994 face = FACE_FROM_ID (it->f, 3994 f = FACE_FROM_ID (it->f,
3995 lookup_basic_face (it->f, DEFAULT_FACE_ID)); 3995 lookup_basic_face (it->f, DEFAULT_FACE_ID));
3996 new_height = (XFLOATINT (it->font_height) 3996 new_height = (XFLOATINT (it->font_height)
3997 * XINT (face->lface[LFACE_HEIGHT_INDEX])); 3997 * XINT (f->lface[LFACE_HEIGHT_INDEX]));
3998 } 3998 }
3999 else 3999 else
4000 { 4000 {
@@ -7982,7 +7982,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
7982 if (nlflag) 7982 if (nlflag)
7983 { 7983 {
7984 EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte; 7984 EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte;
7985 int dup; 7985 int dups;
7986 insert_1 ("\n", 1, 1, 0, 0); 7986 insert_1 ("\n", 1, 1, 0, 0);
7987 7987
7988 scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); 7988 scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0);
@@ -7997,20 +7997,20 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
7997 prev_bol = PT; 7997 prev_bol = PT;
7998 prev_bol_byte = PT_BYTE; 7998 prev_bol_byte = PT_BYTE;
7999 7999
8000 dup = message_log_check_duplicate (prev_bol, prev_bol_byte, 8000 dups = message_log_check_duplicate (prev_bol, prev_bol_byte,
8001 this_bol, this_bol_byte); 8001 this_bol, this_bol_byte);
8002 if (dup) 8002 if (dups)
8003 { 8003 {
8004 del_range_both (prev_bol, prev_bol_byte, 8004 del_range_both (prev_bol, prev_bol_byte,
8005 this_bol, this_bol_byte, 0); 8005 this_bol, this_bol_byte, 0);
8006 if (dup > 1) 8006 if (dups > 1)
8007 { 8007 {
8008 char dupstr[40]; 8008 char dupstr[40];
8009 int duplen; 8009 int duplen;
8010 8010
8011 /* If you change this format, don't forget to also 8011 /* If you change this format, don't forget to also
8012 change message_log_check_duplicate. */ 8012 change message_log_check_duplicate. */
8013 sprintf (dupstr, " [%d times]", dup); 8013 sprintf (dupstr, " [%d times]", dups);
8014 duplen = strlen (dupstr); 8014 duplen = strlen (dupstr);
8015 TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1); 8015 TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1);
8016 insert_1 (dupstr, duplen, 1, 0, 1); 8016 insert_1 (dupstr, duplen, 1, 0, 1);
@@ -8340,20 +8340,20 @@ message_with_string (const char *m, Lisp_Object string, int log)
8340 cmd_error, so this must be just an informative message; toss it. */ 8340 cmd_error, so this must be just an informative message; toss it. */
8341 if (FRAME_MESSAGE_BUF (f)) 8341 if (FRAME_MESSAGE_BUF (f))
8342 { 8342 {
8343 Lisp_Object args[2], message; 8343 Lisp_Object args[2], msg;
8344 struct gcpro gcpro1, gcpro2; 8344 struct gcpro gcpro1, gcpro2;
8345 8345
8346 args[0] = build_string (m); 8346 args[0] = build_string (m);
8347 args[1] = message = string; 8347 args[1] = msg = string;
8348 GCPRO2 (args[0], message); 8348 GCPRO2 (args[0], msg);
8349 gcpro1.nvars = 2; 8349 gcpro1.nvars = 2;
8350 8350
8351 message = Fformat (2, args); 8351 msg = Fformat (2, args);
8352 8352
8353 if (log) 8353 if (log)
8354 message3 (message, SBYTES (message), STRING_MULTIBYTE (message)); 8354 message3 (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
8355 else 8355 else
8356 message3_nolog (message, SBYTES (message), STRING_MULTIBYTE (message)); 8356 message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg));
8357 8357
8358 UNGCPRO; 8358 UNGCPRO;
8359 8359
@@ -11420,8 +11420,8 @@ redisplay_internal (int preserve_echo_area)
11420{ 11420{
11421 struct window *w = XWINDOW (selected_window); 11421 struct window *w = XWINDOW (selected_window);
11422 struct window *sw; 11422 struct window *sw;
11423 struct frame *f; 11423 struct frame *fr;
11424 int pause; 11424 int pending;
11425 int must_finish = 0; 11425 int must_finish = 0;
11426 struct text_pos tlbufpos, tlendpos; 11426 struct text_pos tlbufpos, tlendpos;
11427 int number_of_visible_frames; 11427 int number_of_visible_frames;
@@ -11446,10 +11446,10 @@ redisplay_internal (int preserve_echo_area)
11446 /* Don't examine these until after testing Vinhibit_redisplay. 11446 /* Don't examine these until after testing Vinhibit_redisplay.
11447 When Emacs is shutting down, perhaps because its connection to 11447 When Emacs is shutting down, perhaps because its connection to
11448 X has dropped, we should not look at them at all. */ 11448 X has dropped, we should not look at them at all. */
11449 f = XFRAME (w->frame); 11449 fr = XFRAME (w->frame);
11450 sf = SELECTED_FRAME (); 11450 sf = SELECTED_FRAME ();
11451 11451
11452 if (!f->glyphs_initialized_p) 11452 if (!fr->glyphs_initialized_p)
11453 return; 11453 return;
11454 11454
11455#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) 11455#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
@@ -11491,7 +11491,7 @@ redisplay_internal (int preserve_echo_area)
11491 may need to run Elisp code (via prepare_menu_bars). */ 11491 may need to run Elisp code (via prepare_menu_bars). */
11492 select_frame_for_redisplay (old_frame); 11492 select_frame_for_redisplay (old_frame);
11493 11493
11494 pause = 0; 11494 pending = 0;
11495 reconsider_clip_changes (w, current_buffer); 11495 reconsider_clip_changes (w, current_buffer);
11496 last_escape_glyph_frame = NULL; 11496 last_escape_glyph_frame = NULL;
11497 last_escape_glyph_face_id = (1 << FACE_ID_BITS); 11497 last_escape_glyph_face_id = (1 << FACE_ID_BITS);
@@ -11963,7 +11963,7 @@ redisplay_internal (int preserve_echo_area)
11963 11963
11964 /* Update the display. */ 11964 /* Update the display. */
11965 set_window_update_flags (XWINDOW (f->root_window), 1); 11965 set_window_update_flags (XWINDOW (f->root_window), 1);
11966 pause |= update_frame (f, 0, 0); 11966 pending |= update_frame (f, 0, 0);
11967 f->updated_p = 1; 11967 f->updated_p = 1;
11968 } 11968 }
11969 } 11969 }
@@ -11977,7 +11977,7 @@ redisplay_internal (int preserve_echo_area)
11977 select_frame_for_redisplay (old_frame); 11977 select_frame_for_redisplay (old_frame);
11978 eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window)); 11978 eassert (EQ (XFRAME (selected_frame)->selected_window, selected_window));
11979 11979
11980 if (!pause) 11980 if (!pending)
11981 { 11981 {
11982 /* Do the mark_window_display_accurate after all windows have 11982 /* Do the mark_window_display_accurate after all windows have
11983 been redisplayed because this call resets flags in buffers 11983 been redisplayed because this call resets flags in buffers
@@ -12026,7 +12026,7 @@ redisplay_internal (int preserve_echo_area)
12026 goto retry; 12026 goto retry;
12027 12027
12028 XWINDOW (selected_window)->must_be_updated_p = 1; 12028 XWINDOW (selected_window)->must_be_updated_p = 1;
12029 pause = update_frame (sf, 0, 0); 12029 pending = update_frame (sf, 0, 0);
12030 } 12030 }
12031 12031
12032 /* We may have called echo_area_display at the top of this 12032 /* We may have called echo_area_display at the top of this
@@ -12040,15 +12040,15 @@ redisplay_internal (int preserve_echo_area)
12040 if (mini_frame != sf && FRAME_WINDOW_P (mini_frame)) 12040 if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
12041 { 12041 {
12042 XWINDOW (mini_window)->must_be_updated_p = 1; 12042 XWINDOW (mini_window)->must_be_updated_p = 1;
12043 pause |= update_frame (mini_frame, 0, 0); 12043 pending |= update_frame (mini_frame, 0, 0);
12044 if (!pause && hscroll_windows (mini_window)) 12044 if (!pending && hscroll_windows (mini_window))
12045 goto retry; 12045 goto retry;
12046 } 12046 }
12047 } 12047 }
12048 12048
12049 /* If display was paused because of pending input, make sure we do a 12049 /* If display was paused because of pending input, make sure we do a
12050 thorough update the next time. */ 12050 thorough update the next time. */
12051 if (pause) 12051 if (pending)
12052 { 12052 {
12053 /* Prevent the optimization at the beginning of 12053 /* Prevent the optimization at the beginning of
12054 redisplay_internal that tries a single-line update of the 12054 redisplay_internal that tries a single-line update of the
@@ -12098,7 +12098,7 @@ redisplay_internal (int preserve_echo_area)
12098 redisplay constructing glyphs, so simply exposing a frame won't 12098 redisplay constructing glyphs, so simply exposing a frame won't
12099 display anything in this case. So, we have to display these 12099 display anything in this case. So, we have to display these
12100 frames here explicitly. */ 12100 frames here explicitly. */
12101 if (!pause) 12101 if (!pending)
12102 { 12102 {
12103 Lisp_Object tail, frame; 12103 Lisp_Object tail, frame;
12104 int new_count = 0; 12104 int new_count = 0;
@@ -12126,7 +12126,7 @@ redisplay_internal (int preserve_echo_area)
12126 12126
12127 /* If we just did a pending size change, or have additional 12127 /* If we just did a pending size change, or have additional
12128 visible frames, or selected_window changed, redisplay again. */ 12128 visible frames, or selected_window changed, redisplay again. */
12129 if ((windows_or_buffers_changed && !pause) 12129 if ((windows_or_buffers_changed && !pending)
12130 || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)) 12130 || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw))
12131 goto retry; 12131 goto retry;
12132 12132
@@ -13719,7 +13719,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
13719 int buffer_unchanged_p = 0; 13719 int buffer_unchanged_p = 0;
13720 int temp_scroll_step = 0; 13720 int temp_scroll_step = 0;
13721 int count = SPECPDL_INDEX (); 13721 int count = SPECPDL_INDEX ();
13722 int rc;
13723 int centering_position = -1; 13722 int centering_position = -1;
13724 int last_line_misfit = 0; 13723 int last_line_misfit = 0;
13725 EMACS_INT beg_unchanged, end_unchanged; 13724 EMACS_INT beg_unchanged, end_unchanged;
@@ -14032,12 +14031,15 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14032 /* Handle case where text has not changed, only point, and it has 14031 /* Handle case where text has not changed, only point, and it has
14033 not moved off the frame, and we are not retrying after hscroll. 14032 not moved off the frame, and we are not retrying after hscroll.
14034 (current_matrix_up_to_date_p is nonzero when retrying.) */ 14033 (current_matrix_up_to_date_p is nonzero when retrying.) */
14035 if (current_matrix_up_to_date_p 14034 if (current_matrix_up_to_date_p)
14036 && (rc = try_cursor_movement (window, startp, &temp_scroll_step),
14037 rc != CURSOR_MOVEMENT_CANNOT_BE_USED))
14038 { 14035 {
14036 int rc = try_cursor_movement (window, startp, &temp_scroll_step);
14037
14039 switch (rc) 14038 switch (rc)
14040 { 14039 {
14040 case CURSOR_MOVEMENT_CANNOT_BE_USED:
14041 break;
14042
14041 case CURSOR_MOVEMENT_SUCCESS: 14043 case CURSOR_MOVEMENT_SUCCESS:
14042 used_current_matrix_p = 1; 14044 used_current_matrix_p = 1;
14043 goto done; 14045 goto done;
@@ -14597,7 +14599,7 @@ static int
14597try_window_reusing_current_matrix (struct window *w) 14599try_window_reusing_current_matrix (struct window *w)
14598{ 14600{
14599 struct frame *f = XFRAME (w->frame); 14601 struct frame *f = XFRAME (w->frame);
14600 struct glyph_row *row, *bottom_row; 14602 struct glyph_row *bottom_row;
14601 struct it it; 14603 struct it it;
14602 struct run run; 14604 struct run run;
14603 struct text_pos start, new_start; 14605 struct text_pos start, new_start;
@@ -14706,6 +14708,8 @@ try_window_reusing_current_matrix (struct window *w)
14706 have at least one reusable row. */ 14708 have at least one reusable row. */
14707 if (it.current_y < it.last_visible_y) 14709 if (it.current_y < it.last_visible_y)
14708 { 14710 {
14711 struct glyph_row *row;
14712
14709 /* IT.vpos always starts from 0; it counts text lines. */ 14713 /* IT.vpos always starts from 0; it counts text lines. */
14710 nrows_scrolled = it.vpos - (start_row - MATRIX_FIRST_TEXT_ROW (w->current_matrix)); 14714 nrows_scrolled = it.vpos - (start_row - MATRIX_FIRST_TEXT_ROW (w->current_matrix));
14711 14715
@@ -15491,41 +15495,41 @@ try_window_id (struct window *w)
15491 || (last_changed_charpos < CHARPOS (start) - 1 15495 || (last_changed_charpos < CHARPOS (start) - 1
15492 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n'))) 15496 && FETCH_BYTE (BYTEPOS (start) - 1) == '\n')))
15493 { 15497 {
15494 EMACS_INT Z_old, delta, Z_BYTE_old, delta_bytes; 15498 EMACS_INT Z_old, Z_delta, Z_BYTE_old, Z_delta_bytes;
15495 struct glyph_row *r0; 15499 struct glyph_row *r0;
15496 15500
15497 /* Compute how many chars/bytes have been added to or removed 15501 /* Compute how many chars/bytes have been added to or removed
15498 from the buffer. */ 15502 from the buffer. */
15499 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos); 15503 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
15500 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; 15504 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
15501 delta = Z - Z_old; 15505 Z_delta = Z - Z_old;
15502 delta_bytes = Z_BYTE - Z_BYTE_old; 15506 Z_delta_bytes = Z_BYTE - Z_BYTE_old;
15503 15507
15504 /* Give up if PT is not in the window. Note that it already has 15508 /* Give up if PT is not in the window. Note that it already has
15505 been checked at the start of try_window_id that PT is not in 15509 been checked at the start of try_window_id that PT is not in
15506 front of the window start. */ 15510 front of the window start. */
15507 if (PT >= MATRIX_ROW_END_CHARPOS (row) + delta) 15511 if (PT >= MATRIX_ROW_END_CHARPOS (row) + Z_delta)
15508 GIVE_UP (13); 15512 GIVE_UP (13);
15509 15513
15510 /* If window start is unchanged, we can reuse the whole matrix 15514 /* If window start is unchanged, we can reuse the whole matrix
15511 as is, after adjusting glyph positions. No need to compute 15515 as is, after adjusting glyph positions. No need to compute
15512 the window end again, since its offset from Z hasn't changed. */ 15516 the window end again, since its offset from Z hasn't changed. */
15513 r0 = MATRIX_FIRST_TEXT_ROW (current_matrix); 15517 r0 = MATRIX_FIRST_TEXT_ROW (current_matrix);
15514 if (CHARPOS (start) == MATRIX_ROW_START_CHARPOS (r0) + delta 15518 if (CHARPOS (start) == MATRIX_ROW_START_CHARPOS (r0) + Z_delta
15515 && BYTEPOS (start) == MATRIX_ROW_START_BYTEPOS (r0) + delta_bytes 15519 && BYTEPOS (start) == MATRIX_ROW_START_BYTEPOS (r0) + Z_delta_bytes
15516 /* PT must not be in a partially visible line. */ 15520 /* PT must not be in a partially visible line. */
15517 && !(PT >= MATRIX_ROW_START_CHARPOS (row) + delta 15521 && !(PT >= MATRIX_ROW_START_CHARPOS (row) + Z_delta
15518 && MATRIX_ROW_BOTTOM_Y (row) > window_text_bottom_y (w))) 15522 && MATRIX_ROW_BOTTOM_Y (row) > window_text_bottom_y (w)))
15519 { 15523 {
15520 /* Adjust positions in the glyph matrix. */ 15524 /* Adjust positions in the glyph matrix. */
15521 if (delta || delta_bytes) 15525 if (Z_delta || Z_delta_bytes)
15522 { 15526 {
15523 struct glyph_row *r1 15527 struct glyph_row *r1
15524 = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w); 15528 = MATRIX_BOTTOM_TEXT_ROW (current_matrix, w);
15525 increment_matrix_positions (w->current_matrix, 15529 increment_matrix_positions (w->current_matrix,
15526 MATRIX_ROW_VPOS (r0, current_matrix), 15530 MATRIX_ROW_VPOS (r0, current_matrix),
15527 MATRIX_ROW_VPOS (r1, current_matrix), 15531 MATRIX_ROW_VPOS (r1, current_matrix),
15528 delta, delta_bytes); 15532 Z_delta, Z_delta_bytes);
15529 } 15533 }
15530 15534
15531 /* Set the cursor. */ 15535 /* Set the cursor. */
@@ -15841,9 +15845,9 @@ try_window_id (struct window *w)
15841 { 15845 {
15842 /* Terminal frame. In this case, dvpos gives the number of 15846 /* Terminal frame. In this case, dvpos gives the number of
15843 lines to scroll by; dvpos < 0 means scroll up. */ 15847 lines to scroll by; dvpos < 0 means scroll up. */
15844 int first_unchanged_at_end_vpos 15848 int from_vpos
15845 = MATRIX_ROW_VPOS (first_unchanged_at_end_row, w->current_matrix); 15849 = MATRIX_ROW_VPOS (first_unchanged_at_end_row, w->current_matrix);
15846 int from = WINDOW_TOP_EDGE_LINE (w) + first_unchanged_at_end_vpos; 15850 int from = WINDOW_TOP_EDGE_LINE (w) + from_vpos;
15847 int end = (WINDOW_TOP_EDGE_LINE (w) 15851 int end = (WINDOW_TOP_EDGE_LINE (w)
15848 + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) 15852 + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0)
15849 + window_internal_height (w)); 15853 + window_internal_height (w));
@@ -16574,7 +16578,6 @@ static void
16574compute_line_metrics (struct it *it) 16578compute_line_metrics (struct it *it)
16575{ 16579{
16576 struct glyph_row *row = it->glyph_row; 16580 struct glyph_row *row = it->glyph_row;
16577 int area, i;
16578 16581
16579 if (FRAME_WINDOW_P (it->f)) 16582 if (FRAME_WINDOW_P (it->f))
16580 { 16583 {
@@ -16639,14 +16642,17 @@ compute_line_metrics (struct it *it)
16639 } 16642 }
16640 16643
16641 /* Compute a hash code for this row. */ 16644 /* Compute a hash code for this row. */
16642 row->hash = 0; 16645 {
16643 for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) 16646 int area, i;
16644 for (i = 0; i < row->used[area]; ++i) 16647 row->hash = 0;
16645 row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff) 16648 for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area)
16646 + row->glyphs[area][i].u.val 16649 for (i = 0; i < row->used[area]; ++i)
16647 + row->glyphs[area][i].face_id 16650 row->hash = ((((row->hash << 4) + (row->hash >> 24)) & 0x0fffffff)
16648 + row->glyphs[area][i].padding_p 16651 + row->glyphs[area][i].u.val
16649 + (row->glyphs[area][i].type << 2)); 16652 + row->glyphs[area][i].face_id
16653 + row->glyphs[area][i].padding_p
16654 + (row->glyphs[area][i].type << 2));
16655 }
16650 16656
16651 it->max_ascent = it->max_descent = 0; 16657 it->max_ascent = it->max_descent = 0;
16652 it->max_phys_ascent = it->max_phys_descent = 0; 16658 it->max_phys_ascent = it->max_phys_descent = 0;
@@ -16979,7 +16985,7 @@ highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
16979static int 16985static int
16980cursor_row_p (struct window *w, struct glyph_row *row) 16986cursor_row_p (struct window *w, struct glyph_row *row)
16981{ 16987{
16982 int cursor_row_p = 1; 16988 int result = 1;
16983 16989
16984 if (PT == CHARPOS (row->end.pos)) 16990 if (PT == CHARPOS (row->end.pos))
16985 { 16991 {
@@ -16992,7 +16998,7 @@ cursor_row_p (struct window *w, struct glyph_row *row)
16992 if (CHARPOS (row->end.string_pos) >= 0) 16998 if (CHARPOS (row->end.string_pos) >= 0)
16993 { 16999 {
16994 if (row->continued_p) 17000 if (row->continued_p)
16995 cursor_row_p = 1; 17001 result = 1;
16996 else 17002 else
16997 { 17003 {
16998 /* Check for `display' property. */ 17004 /* Check for `display' property. */
@@ -17000,14 +17006,14 @@ cursor_row_p (struct window *w, struct glyph_row *row)
17000 struct glyph *end = beg + row->used[TEXT_AREA] - 1; 17006 struct glyph *end = beg + row->used[TEXT_AREA] - 1;
17001 struct glyph *glyph; 17007 struct glyph *glyph;
17002 17008
17003 cursor_row_p = 0; 17009 result = 0;
17004 for (glyph = end; glyph >= beg; --glyph) 17010 for (glyph = end; glyph >= beg; --glyph)
17005 if (STRINGP (glyph->object)) 17011 if (STRINGP (glyph->object))
17006 { 17012 {
17007 Lisp_Object prop 17013 Lisp_Object prop
17008 = Fget_char_property (make_number (PT), 17014 = Fget_char_property (make_number (PT),
17009 Qdisplay, Qnil); 17015 Qdisplay, Qnil);
17010 cursor_row_p = 17016 result =
17011 (!NILP (prop) 17017 (!NILP (prop)
17012 && display_prop_string_p (prop, glyph->object)); 17018 && display_prop_string_p (prop, glyph->object));
17013 break; 17019 break;
@@ -17021,23 +17027,23 @@ cursor_row_p (struct window *w, struct glyph_row *row)
17021 That's because CHARPOS (ROW->end.pos) would equal 17027 That's because CHARPOS (ROW->end.pos) would equal
17022 PT if PT is before the character. */ 17028 PT if PT is before the character. */
17023 if (!row->ends_in_ellipsis_p) 17029 if (!row->ends_in_ellipsis_p)
17024 cursor_row_p = row->continued_p; 17030 result = row->continued_p;
17025 else 17031 else
17026 /* If the row ends in an ellipsis, then 17032 /* If the row ends in an ellipsis, then
17027 CHARPOS (ROW->end.pos) will equal point after the 17033 CHARPOS (ROW->end.pos) will equal point after the
17028 invisible text. We want that position to be displayed 17034 invisible text. We want that position to be displayed
17029 after the ellipsis. */ 17035 after the ellipsis. */
17030 cursor_row_p = 0; 17036 result = 0;
17031 } 17037 }
17032 /* If the row ends at ZV, display the cursor at the end of that 17038 /* If the row ends at ZV, display the cursor at the end of that
17033 row instead of at the start of the row below. */ 17039 row instead of at the start of the row below. */
17034 else if (row->ends_at_zv_p) 17040 else if (row->ends_at_zv_p)
17035 cursor_row_p = 1; 17041 result = 1;
17036 else 17042 else
17037 cursor_row_p = 0; 17043 result = 0;
17038 } 17044 }
17039 17045
17040 return cursor_row_p; 17046 return result;
17041} 17047}
17042 17048
17043 17049
@@ -17345,7 +17351,7 @@ display_line (struct it *it)
17345 while (1) 17351 while (1)
17346 { 17352 {
17347 int n_glyphs_before, hpos_before, x_before; 17353 int n_glyphs_before, hpos_before, x_before;
17348 int x, i, nglyphs; 17354 int x, nglyphs;
17349 int ascent = 0, descent = 0, phys_ascent = 0, phys_descent = 0; 17355 int ascent = 0, descent = 0, phys_ascent = 0, phys_descent = 0;
17350 17356
17351 /* Retrieve the next thing to display. Value is zero if end of 17357 /* Retrieve the next thing to display. Value is zero if end of
@@ -17470,7 +17476,7 @@ display_line (struct it *it)
17470 } 17476 }
17471 else 17477 else
17472 { 17478 {
17473 int new_x; 17479 int i, new_x;
17474 struct glyph *glyph; 17480 struct glyph *glyph;
17475 17481
17476 for (i = 0; i < nglyphs; ++i, x = new_x) 17482 for (i = 0; i < nglyphs; ++i, x = new_x)
@@ -19924,16 +19930,16 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st
19924 { 19930 {
19925 if (!FRAME_WINDOW_P (it->f)) 19931 if (!FRAME_WINDOW_P (it->f))
19926 { 19932 {
19927 int i, n; 19933 int ii, n;
19928 19934
19929 if (it->current_x > it->last_visible_x) 19935 if (it->current_x > it->last_visible_x)
19930 { 19936 {
19931 for (i = row->used[TEXT_AREA] - 1; i > 0; --i) 19937 for (ii = row->used[TEXT_AREA] - 1; ii > 0; --ii)
19932 if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i])) 19938 if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][ii]))
19933 break; 19939 break;
19934 for (n = row->used[TEXT_AREA]; i < n; ++i) 19940 for (n = row->used[TEXT_AREA]; ii < n; ++ii)
19935 { 19941 {
19936 row->used[TEXT_AREA] = i; 19942 row->used[TEXT_AREA] = ii;
19937 produce_special_glyphs (it, IT_TRUNCATION); 19943 produce_special_glyphs (it, IT_TRUNCATION);
19938 } 19944 }
19939 } 19945 }
@@ -24197,7 +24203,7 @@ rows_from_pos_range (struct window *w,
24197 for the overlay or run of text properties specifying the mouse 24203 for the overlay or run of text properties specifying the mouse
24198 face. BEFORE_STRING and AFTER_STRING, if non-nil, are a 24204 face. BEFORE_STRING and AFTER_STRING, if non-nil, are a
24199 before-string and after-string that must also be highlighted. 24205 before-string and after-string that must also be highlighted.
24200 DISPLAY_STRING, if non-nil, is a display string that may cover some 24206 COVER_STRING, if non-nil, is a display string that may cover some
24201 or all of the highlighted text. */ 24207 or all of the highlighted text. */
24202 24208
24203static void 24209static void
@@ -24208,7 +24214,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24208 EMACS_INT end_charpos, 24214 EMACS_INT end_charpos,
24209 Lisp_Object before_string, 24215 Lisp_Object before_string,
24210 Lisp_Object after_string, 24216 Lisp_Object after_string,
24211 Lisp_Object display_string) 24217 Lisp_Object cover_string)
24212{ 24218{
24213 struct window *w = XWINDOW (window); 24219 struct window *w = XWINDOW (window);
24214 struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 24220 struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
@@ -24217,7 +24223,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24217 EMACS_INT ignore, pos; 24223 EMACS_INT ignore, pos;
24218 int x; 24224 int x;
24219 24225
24220 xassert (NILP (display_string) || STRINGP (display_string)); 24226 xassert (NILP (cover_string) || STRINGP (cover_string));
24221 xassert (NILP (before_string) || STRINGP (before_string)); 24227 xassert (NILP (before_string) || STRINGP (before_string));
24222 xassert (NILP (after_string) || STRINGP (after_string)); 24228 xassert (NILP (after_string) || STRINGP (after_string));
24223 24229
@@ -24227,7 +24233,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24227 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); 24233 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
24228 /* If the before-string or display-string contains newlines, 24234 /* If the before-string or display-string contains newlines,
24229 rows_from_pos_range skips to its last row. Move back. */ 24235 rows_from_pos_range skips to its last row. Move back. */
24230 if (!NILP (before_string) || !NILP (display_string)) 24236 if (!NILP (before_string) || !NILP (cover_string))
24231 { 24237 {
24232 struct glyph_row *prev; 24238 struct glyph_row *prev;
24233 while ((prev = r1 - 1, prev >= first) 24239 while ((prev = r1 - 1, prev >= first)
@@ -24239,7 +24245,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24239 while (--glyph >= beg && INTEGERP (glyph->object)); 24245 while (--glyph >= beg && INTEGERP (glyph->object));
24240 if (glyph < beg 24246 if (glyph < beg
24241 || !(EQ (glyph->object, before_string) 24247 || !(EQ (glyph->object, before_string)
24242 || EQ (glyph->object, display_string))) 24248 || EQ (glyph->object, cover_string)))
24243 break; 24249 break;
24244 r1 = prev; 24250 r1 = prev;
24245 } 24251 }
@@ -24282,7 +24288,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24282 hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); 24288 hlinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix);
24283 24289
24284 /* For a bidi-reordered row, the positions of BEFORE_STRING, 24290 /* For a bidi-reordered row, the positions of BEFORE_STRING,
24285 AFTER_STRING, DISPLAY_STRING, START_CHARPOS, and END_CHARPOS 24291 AFTER_STRING, COVER_STRING, START_CHARPOS, and END_CHARPOS
24286 could be anywhere in the row and in any order. The strategy 24292 could be anywhere in the row and in any order. The strategy
24287 below is to find the leftmost and the rightmost glyph that 24293 below is to find the leftmost and the rightmost glyph that
24288 belongs to either of these 3 strings, or whose position is 24294 belongs to either of these 3 strings, or whose position is
@@ -24308,11 +24314,11 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24308 x += glyph->pixel_width; 24314 x += glyph->pixel_width;
24309 24315
24310 /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, 24316 /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING,
24311 or DISPLAY_STRING, and the first glyph from buffer whose 24317 or COVER_STRING, and the first glyph from buffer whose
24312 position is between START_CHARPOS and END_CHARPOS. */ 24318 position is between START_CHARPOS and END_CHARPOS. */
24313 for (; glyph < end 24319 for (; glyph < end
24314 && !INTEGERP (glyph->object) 24320 && !INTEGERP (glyph->object)
24315 && !EQ (glyph->object, display_string) 24321 && !EQ (glyph->object, cover_string)
24316 && !(BUFFERP (glyph->object) 24322 && !(BUFFERP (glyph->object)
24317 && (glyph->charpos >= start_charpos 24323 && (glyph->charpos >= start_charpos
24318 && glyph->charpos < end_charpos)); 24324 && glyph->charpos < end_charpos));
@@ -24359,11 +24365,11 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24359 ; 24365 ;
24360 24366
24361 /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, 24367 /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING,
24362 or DISPLAY_STRING, and the first glyph from buffer whose 24368 or COVER_STRING, and the first glyph from buffer whose
24363 position is between START_CHARPOS and END_CHARPOS. */ 24369 position is between START_CHARPOS and END_CHARPOS. */
24364 for (; glyph > end 24370 for (; glyph > end
24365 && !INTEGERP (glyph->object) 24371 && !INTEGERP (glyph->object)
24366 && !EQ (glyph->object, display_string) 24372 && !EQ (glyph->object, cover_string)
24367 && !(BUFFERP (glyph->object) 24373 && !(BUFFERP (glyph->object)
24368 && (glyph->charpos >= start_charpos 24374 && (glyph->charpos >= start_charpos
24369 && glyph->charpos < end_charpos)); 24375 && glyph->charpos < end_charpos));
@@ -24424,12 +24430,12 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24424 --end; 24430 --end;
24425 /* Scan the rest of the glyph row from the end, looking for the 24431 /* Scan the rest of the glyph row from the end, looking for the
24426 first glyph that comes from BEFORE_STRING, AFTER_STRING, or 24432 first glyph that comes from BEFORE_STRING, AFTER_STRING, or
24427 DISPLAY_STRING, or whose position is between START_CHARPOS 24433 COVER_STRING, or whose position is between START_CHARPOS
24428 and END_CHARPOS */ 24434 and END_CHARPOS */
24429 for (--end; 24435 for (--end;
24430 end > glyph 24436 end > glyph
24431 && !INTEGERP (end->object) 24437 && !INTEGERP (end->object)
24432 && !EQ (end->object, display_string) 24438 && !EQ (end->object, cover_string)
24433 && !(BUFFERP (end->object) 24439 && !(BUFFERP (end->object)
24434 && (end->charpos >= start_charpos 24440 && (end->charpos >= start_charpos
24435 && end->charpos < end_charpos)); 24441 && end->charpos < end_charpos));
@@ -24474,12 +24480,12 @@ mouse_face_from_buffer_pos (Lisp_Object window,
24474 } 24480 }
24475 /* Scan the rest of the glyph row from the end, looking for the 24481 /* Scan the rest of the glyph row from the end, looking for the
24476 first glyph that comes from BEFORE_STRING, AFTER_STRING, or 24482 first glyph that comes from BEFORE_STRING, AFTER_STRING, or
24477 DISPLAY_STRING, or whose position is between START_CHARPOS 24483 COVER_STRING, or whose position is between START_CHARPOS
24478 and END_CHARPOS */ 24484 and END_CHARPOS */
24479 for ( ; 24485 for ( ;
24480 end < glyph 24486 end < glyph
24481 && !INTEGERP (end->object) 24487 && !INTEGERP (end->object)
24482 && !EQ (end->object, display_string) 24488 && !EQ (end->object, cover_string)
24483 && !(BUFFERP (end->object) 24489 && !(BUFFERP (end->object)
24484 && (end->charpos >= start_charpos 24490 && (end->charpos >= start_charpos
24485 && end->charpos < end_charpos)); 24491 && end->charpos < end_charpos));
@@ -25285,7 +25291,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
25285 EMACS_INT pos; 25291 EMACS_INT pos;
25286 struct glyph *glyph; 25292 struct glyph *glyph;
25287 Lisp_Object object; 25293 Lisp_Object object;
25288 Lisp_Object mouse_face = Qnil, overlay = Qnil, position; 25294 Lisp_Object mouse_face = Qnil, position;
25289 Lisp_Object *overlay_vec = NULL; 25295 Lisp_Object *overlay_vec = NULL;
25290 int noverlays; 25296 int noverlays;
25291 struct buffer *obuf; 25297 struct buffer *obuf;
@@ -25418,7 +25424,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
25418 && mouse_face_overlay_overlaps (hlinfo->mouse_face_overlay))) 25424 && mouse_face_overlay_overlaps (hlinfo->mouse_face_overlay)))
25419 { 25425 {
25420 /* Find the highest priority overlay with a mouse-face. */ 25426 /* Find the highest priority overlay with a mouse-face. */
25421 overlay = Qnil; 25427 Lisp_Object overlay = Qnil;
25422 for (i = noverlays - 1; i >= 0 && NILP (overlay); --i) 25428 for (i = noverlays - 1; i >= 0 && NILP (overlay); --i)
25423 { 25429 {
25424 mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face); 25430 mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face);
@@ -25446,19 +25452,19 @@ note_mouse_highlight (struct frame *f, int x, int y)
25446 { 25452 {
25447 /* The mouse-highlighting comes from a display string 25453 /* The mouse-highlighting comes from a display string
25448 with a mouse-face. */ 25454 with a mouse-face. */
25449 Lisp_Object b, e; 25455 Lisp_Object s, e;
25450 EMACS_INT ignore; 25456 EMACS_INT ignore;
25451 25457
25452 b = Fprevious_single_property_change 25458 s = Fprevious_single_property_change
25453 (make_number (pos + 1), Qmouse_face, object, Qnil); 25459 (make_number (pos + 1), Qmouse_face, object, Qnil);
25454 e = Fnext_single_property_change 25460 e = Fnext_single_property_change
25455 (position, Qmouse_face, object, Qnil); 25461 (position, Qmouse_face, object, Qnil);
25456 if (NILP (b)) 25462 if (NILP (s))
25457 b = make_number (0); 25463 s = make_number (0);
25458 if (NILP (e)) 25464 if (NILP (e))
25459 e = make_number (SCHARS (object) - 1); 25465 e = make_number (SCHARS (object) - 1);
25460 mouse_face_from_string_pos (w, hlinfo, object, 25466 mouse_face_from_string_pos (w, hlinfo, object,
25461 XINT (b), XINT (e)); 25467 XINT (s), XINT (e));
25462 hlinfo->mouse_face_past_end = 0; 25468 hlinfo->mouse_face_past_end = 0;
25463 hlinfo->mouse_face_window = window; 25469 hlinfo->mouse_face_window = window;
25464 hlinfo->mouse_face_face_id 25470 hlinfo->mouse_face_face_id
@@ -25471,7 +25477,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
25471 { 25477 {
25472 /* The mouse-highlighting, if any, comes from an overlay 25478 /* The mouse-highlighting, if any, comes from an overlay
25473 or text property in the buffer. */ 25479 or text property in the buffer. */
25474 Lisp_Object buffer, display_string; 25480 Lisp_Object buffer, cover_string;
25475 25481
25476 if (STRINGP (object)) 25482 if (STRINGP (object))
25477 { 25483 {
@@ -25485,13 +25491,13 @@ note_mouse_highlight (struct frame *f, int x, int y)
25485 mouse_face = get_char_property_and_overlay 25491 mouse_face = get_char_property_and_overlay
25486 (make_number (pos), Qmouse_face, w->buffer, &overlay); 25492 (make_number (pos), Qmouse_face, w->buffer, &overlay);
25487 buffer = w->buffer; 25493 buffer = w->buffer;
25488 display_string = object; 25494 cover_string = object;
25489 } 25495 }
25490 } 25496 }
25491 else 25497 else
25492 { 25498 {
25493 buffer = object; 25499 buffer = object;
25494 display_string = Qnil; 25500 cover_string = Qnil;
25495 } 25501 }
25496 25502
25497 if (!NILP (mouse_face)) 25503 if (!NILP (mouse_face))
@@ -25543,7 +25549,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
25543 XFASTINT (before), 25549 XFASTINT (before),
25544 XFASTINT (after), 25550 XFASTINT (after),
25545 before_string, after_string, 25551 before_string, after_string,
25546 display_string); 25552 cover_string);
25547 cursor = No_Cursor; 25553 cursor = No_Cursor;
25548 } 25554 }
25549 } 25555 }
@@ -25572,16 +25578,16 @@ note_mouse_highlight (struct frame *f, int x, int y)
25572 } 25578 }
25573 else 25579 else
25574 { 25580 {
25575 Lisp_Object object = glyph->object; 25581 Lisp_Object obj = glyph->object;
25576 EMACS_INT charpos = glyph->charpos; 25582 EMACS_INT charpos = glyph->charpos;
25577 25583
25578 /* Try text properties. */ 25584 /* Try text properties. */
25579 if (STRINGP (object) 25585 if (STRINGP (obj)
25580 && charpos >= 0 25586 && charpos >= 0
25581 && charpos < SCHARS (object)) 25587 && charpos < SCHARS (obj))
25582 { 25588 {
25583 help = Fget_text_property (make_number (charpos), 25589 help = Fget_text_property (make_number (charpos),
25584 Qhelp_echo, object); 25590 Qhelp_echo, obj);
25585 if (NILP (help)) 25591 if (NILP (help))
25586 { 25592 {
25587 /* If the string itself doesn't specify a help-echo, 25593 /* If the string itself doesn't specify a help-echo,
@@ -25589,30 +25595,30 @@ note_mouse_highlight (struct frame *f, int x, int y)
25589 struct glyph_row *r 25595 struct glyph_row *r
25590 = MATRIX_ROW (w->current_matrix, vpos); 25596 = MATRIX_ROW (w->current_matrix, vpos);
25591 EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); 25597 EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
25592 EMACS_INT pos = string_buffer_position (w, object, start); 25598 EMACS_INT p = string_buffer_position (w, obj, start);
25593 if (pos > 0) 25599 if (p > 0)
25594 { 25600 {
25595 help = Fget_char_property (make_number (pos), 25601 help = Fget_char_property (make_number (p),
25596 Qhelp_echo, w->buffer); 25602 Qhelp_echo, w->buffer);
25597 if (!NILP (help)) 25603 if (!NILP (help))
25598 { 25604 {
25599 charpos = pos; 25605 charpos = p;
25600 object = w->buffer; 25606 obj = w->buffer;
25601 } 25607 }
25602 } 25608 }
25603 } 25609 }
25604 } 25610 }
25605 else if (BUFFERP (object) 25611 else if (BUFFERP (obj)
25606 && charpos >= BEGV 25612 && charpos >= BEGV
25607 && charpos < ZV) 25613 && charpos < ZV)
25608 help = Fget_text_property (make_number (charpos), Qhelp_echo, 25614 help = Fget_text_property (make_number (charpos), Qhelp_echo,
25609 object); 25615 obj);
25610 25616
25611 if (!NILP (help)) 25617 if (!NILP (help))
25612 { 25618 {
25613 help_echo_string = help; 25619 help_echo_string = help;
25614 help_echo_window = window; 25620 help_echo_window = window;
25615 help_echo_object = object; 25621 help_echo_object = obj;
25616 help_echo_pos = charpos; 25622 help_echo_pos = charpos;
25617 } 25623 }
25618 } 25624 }
@@ -25628,16 +25634,16 @@ note_mouse_highlight (struct frame *f, int x, int y)
25628 25634
25629 if (NILP (pointer)) 25635 if (NILP (pointer))
25630 { 25636 {
25631 Lisp_Object object = glyph->object; 25637 Lisp_Object obj = glyph->object;
25632 EMACS_INT charpos = glyph->charpos; 25638 EMACS_INT charpos = glyph->charpos;
25633 25639
25634 /* Try text properties. */ 25640 /* Try text properties. */
25635 if (STRINGP (object) 25641 if (STRINGP (obj)
25636 && charpos >= 0 25642 && charpos >= 0
25637 && charpos < SCHARS (object)) 25643 && charpos < SCHARS (obj))
25638 { 25644 {
25639 pointer = Fget_text_property (make_number (charpos), 25645 pointer = Fget_text_property (make_number (charpos),
25640 Qpointer, object); 25646 Qpointer, obj);
25641 if (NILP (pointer)) 25647 if (NILP (pointer))
25642 { 25648 {
25643 /* If the string itself doesn't specify a pointer, 25649 /* If the string itself doesn't specify a pointer,
@@ -25645,18 +25651,17 @@ note_mouse_highlight (struct frame *f, int x, int y)
25645 struct glyph_row *r 25651 struct glyph_row *r
25646 = MATRIX_ROW (w->current_matrix, vpos); 25652 = MATRIX_ROW (w->current_matrix, vpos);
25647 EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); 25653 EMACS_INT start = MATRIX_ROW_START_CHARPOS (r);
25648 EMACS_INT pos = string_buffer_position (w, object, 25654 EMACS_INT p = string_buffer_position (w, obj, start);
25649 start); 25655 if (p > 0)
25650 if (pos > 0) 25656 pointer = Fget_char_property (make_number (p),
25651 pointer = Fget_char_property (make_number (pos),
25652 Qpointer, w->buffer); 25657 Qpointer, w->buffer);
25653 } 25658 }
25654 } 25659 }
25655 else if (BUFFERP (object) 25660 else if (BUFFERP (obj)
25656 && charpos >= BEGV 25661 && charpos >= BEGV
25657 && charpos < ZV) 25662 && charpos < ZV)
25658 pointer = Fget_text_property (make_number (charpos), 25663 pointer = Fget_text_property (make_number (charpos),
25659 Qpointer, object); 25664 Qpointer, obj);
25660 } 25665 }
25661 } 25666 }
25662#endif /* HAVE_WINDOW_SYSTEM */ 25667#endif /* HAVE_WINDOW_SYSTEM */
@@ -26177,10 +26182,10 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
26177 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 26182 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
26178 if (f == hlinfo->mouse_face_mouse_frame) 26183 if (f == hlinfo->mouse_face_mouse_frame)
26179 { 26184 {
26180 int x = hlinfo->mouse_face_mouse_x; 26185 int mouse_x = hlinfo->mouse_face_mouse_x;
26181 int y = hlinfo->mouse_face_mouse_y; 26186 int mouse_y = hlinfo->mouse_face_mouse_y;
26182 clear_mouse_face (hlinfo); 26187 clear_mouse_face (hlinfo);
26183 note_mouse_highlight (f, x, y); 26188 note_mouse_highlight (f, mouse_x, mouse_y);
26184 } 26189 }
26185 } 26190 }
26186} 26191}