diff options
| author | Thien-Thi Nguyen | 2002-06-03 01:50:02 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2002-06-03 01:50:02 +0000 |
| commit | 2311178e46c8b3bf678e25bb1c88b6c4724d9baa (patch) | |
| tree | 17575359a0a795065d9fe827f560ee0f58a4a799 /src | |
| parent | 9ab4a725bb54fe5ed48562bd9787a6f240b389cf (diff) | |
| download | emacs-2311178e46c8b3bf678e25bb1c88b6c4724d9baa.tar.gz emacs-2311178e46c8b3bf678e25bb1c88b6c4724d9baa.zip | |
(redisplay_internal, redisplay_window, decode_mode_spec): Cast
`current_column' return value to int.
(back_to_previous_visible_line_start, reseat_at_next_visible_line_start,
next_element_from_buffer): Cast `indented_beyond_p' 3rd arg to float.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 1025 |
1 files changed, 514 insertions, 511 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 5eaf8330797..a6870316e0c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 47 | you will encounter bugs which are very hard to explain. | 47 | you will encounter bugs which are very hard to explain. |
| 48 | 48 | ||
| 49 | (Direct functions, see below) | 49 | (Direct functions, see below) |
| 50 | direct_output_for_insert, | 50 | direct_output_for_insert, |
| 51 | direct_forward_char (dispnew.c) | 51 | direct_forward_char (dispnew.c) |
| 52 | +---------------------------------+ | 52 | +---------------------------------+ |
| 53 | | | | 53 | | | |
| @@ -106,7 +106,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 106 | `direct_output_for_insert' and `direct_output_forward_char' in | 106 | `direct_output_for_insert' and `direct_output_forward_char' in |
| 107 | dispnew.c. | 107 | dispnew.c. |
| 108 | 108 | ||
| 109 | 109 | ||
| 110 | Desired matrices. | 110 | Desired matrices. |
| 111 | 111 | ||
| 112 | Desired matrices are always built per Emacs window. The function | 112 | Desired matrices are always built per Emacs window. The function |
| @@ -338,7 +338,7 @@ int truncate_partial_width_windows; | |||
| 338 | /* A flag to control how to display unibyte 8-bit character. */ | 338 | /* A flag to control how to display unibyte 8-bit character. */ |
| 339 | 339 | ||
| 340 | int unibyte_display_via_language_environment; | 340 | int unibyte_display_via_language_environment; |
| 341 | 341 | ||
| 342 | /* Nonzero means we have more than one non-mini-buffer-only frame. | 342 | /* Nonzero means we have more than one non-mini-buffer-only frame. |
| 343 | Not guaranteed to be accurate except while parsing | 343 | Not guaranteed to be accurate except while parsing |
| 344 | frame-title-format. */ | 344 | frame-title-format. */ |
| @@ -555,7 +555,7 @@ int help_echo_showing_p; | |||
| 555 | int current_mode_line_height, current_header_line_height; | 555 | int current_mode_line_height, current_header_line_height; |
| 556 | 556 | ||
| 557 | /* The maximum distance to look ahead for text properties. Values | 557 | /* The maximum distance to look ahead for text properties. Values |
| 558 | that are too small let us call compute_char_face and similar | 558 | that are too small let us call compute_char_face and similar |
| 559 | functions too often which is expensive. Values that are too large | 559 | functions too often which is expensive. Values that are too large |
| 560 | let us call compute_char_face and alike too often because we | 560 | let us call compute_char_face and alike too often because we |
| 561 | might not be interested in text properties that far away. */ | 561 | might not be interested in text properties that far away. */ |
| @@ -584,7 +584,7 @@ int trace_move; | |||
| 584 | #else | 584 | #else |
| 585 | #define TRACE_MOVE(x) (void) 0 | 585 | #define TRACE_MOVE(x) (void) 0 |
| 586 | #endif | 586 | #endif |
| 587 | 587 | ||
| 588 | /* Non-zero means automatically scroll windows horizontally to make | 588 | /* Non-zero means automatically scroll windows horizontally to make |
| 589 | point visible. */ | 589 | point visible. */ |
| 590 | 590 | ||
| @@ -680,7 +680,7 @@ enum move_it_result | |||
| 680 | /* Move within a line ended at the end of a line that must be | 680 | /* Move within a line ended at the end of a line that must be |
| 681 | continued. */ | 681 | continued. */ |
| 682 | MOVE_LINE_CONTINUED, | 682 | MOVE_LINE_CONTINUED, |
| 683 | 683 | ||
| 684 | /* Move within a line ended at the end of a line that would | 684 | /* Move within a line ended at the end of a line that would |
| 685 | be displayed truncated. */ | 685 | be displayed truncated. */ |
| 686 | MOVE_LINE_TRUNCATED, | 686 | MOVE_LINE_TRUNCATED, |
| @@ -859,11 +859,11 @@ window_box_width (w, area) | |||
| 859 | { | 859 | { |
| 860 | struct frame *f = XFRAME (w->frame); | 860 | struct frame *f = XFRAME (w->frame); |
| 861 | int width = XFASTINT (w->width); | 861 | int width = XFASTINT (w->width); |
| 862 | 862 | ||
| 863 | if (!w->pseudo_window_p) | 863 | if (!w->pseudo_window_p) |
| 864 | { | 864 | { |
| 865 | width -= FRAME_SCROLL_BAR_WIDTH (f) + FRAME_FRINGE_COLS (f); | 865 | width -= FRAME_SCROLL_BAR_WIDTH (f) + FRAME_FRINGE_COLS (f); |
| 866 | 866 | ||
| 867 | if (area == TEXT_AREA) | 867 | if (area == TEXT_AREA) |
| 868 | { | 868 | { |
| 869 | if (INTEGERP (w->left_margin_width)) | 869 | if (INTEGERP (w->left_margin_width)) |
| @@ -894,7 +894,7 @@ window_box_height (w) | |||
| 894 | int height = XFASTINT (w->height) * CANON_Y_UNIT (f); | 894 | int height = XFASTINT (w->height) * CANON_Y_UNIT (f); |
| 895 | 895 | ||
| 896 | xassert (height >= 0); | 896 | xassert (height >= 0); |
| 897 | 897 | ||
| 898 | /* Note: the code below that determines the mode-line/header-line | 898 | /* Note: the code below that determines the mode-line/header-line |
| 899 | height is essentially the same as that contained in the macro | 899 | height is essentially the same as that contained in the macro |
| 900 | CURRENT_{MODE,HEADER}_LINE_HEIGHT, except that it checks whether | 900 | CURRENT_{MODE,HEADER}_LINE_HEIGHT, except that it checks whether |
| @@ -947,7 +947,7 @@ window_box_left (w, area) | |||
| 947 | { | 947 | { |
| 948 | x += (WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f) | 948 | x += (WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f) |
| 949 | + FRAME_LEFT_FRINGE_WIDTH (f)); | 949 | + FRAME_LEFT_FRINGE_WIDTH (f)); |
| 950 | 950 | ||
| 951 | if (area == TEXT_AREA) | 951 | if (area == TEXT_AREA) |
| 952 | x += window_box_width (w, LEFT_MARGIN_AREA); | 952 | x += window_box_width (w, LEFT_MARGIN_AREA); |
| 953 | else if (area == RIGHT_MARGIN_AREA) | 953 | else if (area == RIGHT_MARGIN_AREA) |
| @@ -956,7 +956,7 @@ window_box_left (w, area) | |||
| 956 | } | 956 | } |
| 957 | 957 | ||
| 958 | return x; | 958 | return x; |
| 959 | } | 959 | } |
| 960 | 960 | ||
| 961 | 961 | ||
| 962 | /* Return the frame-relative coordinate of the right edge of display | 962 | /* Return the frame-relative coordinate of the right edge of display |
| @@ -969,8 +969,8 @@ window_box_right (w, area) | |||
| 969 | int area; | 969 | int area; |
| 970 | { | 970 | { |
| 971 | return window_box_left (w, area) + window_box_width (w, area); | 971 | return window_box_left (w, area) + window_box_width (w, area); |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | 974 | ||
| 975 | /* Get the bounding box of the display area AREA of window W, without | 975 | /* Get the bounding box of the display area AREA of window W, without |
| 976 | mode lines, in frame-relative coordinates. AREA < 0 means the | 976 | mode lines, in frame-relative coordinates. AREA < 0 means the |
| @@ -986,7 +986,7 @@ window_box (w, area, box_x, box_y, box_width, box_height) | |||
| 986 | int *box_x, *box_y, *box_width, *box_height; | 986 | int *box_x, *box_y, *box_width, *box_height; |
| 987 | { | 987 | { |
| 988 | struct frame *f = XFRAME (w->frame); | 988 | struct frame *f = XFRAME (w->frame); |
| 989 | 989 | ||
| 990 | *box_width = window_box_width (w, area); | 990 | *box_width = window_box_width (w, area); |
| 991 | *box_height = window_box_height (w); | 991 | *box_height = window_box_height (w); |
| 992 | *box_x = window_box_left (w, area); | 992 | *box_x = window_box_left (w, area); |
| @@ -1033,7 +1033,7 @@ line_bottom_y (it) | |||
| 1033 | { | 1033 | { |
| 1034 | int line_height = it->max_ascent + it->max_descent; | 1034 | int line_height = it->max_ascent + it->max_descent; |
| 1035 | int line_top_y = it->current_y; | 1035 | int line_top_y = it->current_y; |
| 1036 | 1036 | ||
| 1037 | if (line_height == 0) | 1037 | if (line_height == 0) |
| 1038 | { | 1038 | { |
| 1039 | if (last_height) | 1039 | if (last_height) |
| @@ -1048,7 +1048,7 @@ line_bottom_y (it) | |||
| 1048 | else | 1048 | else |
| 1049 | { | 1049 | { |
| 1050 | struct glyph_row *row = it->glyph_row; | 1050 | struct glyph_row *row = it->glyph_row; |
| 1051 | 1051 | ||
| 1052 | /* Use the default character height. */ | 1052 | /* Use the default character height. */ |
| 1053 | it->glyph_row = NULL; | 1053 | it->glyph_row = NULL; |
| 1054 | it->what = IT_CHARACTER; | 1054 | it->what = IT_CHARACTER; |
| @@ -1087,7 +1087,7 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) | |||
| 1087 | 1087 | ||
| 1088 | *fully = visible_p = 0; | 1088 | *fully = visible_p = 0; |
| 1089 | SET_TEXT_POS_FROM_MARKER (top, w->start); | 1089 | SET_TEXT_POS_FROM_MARKER (top, w->start); |
| 1090 | 1090 | ||
| 1091 | /* Compute exact mode line heights, if requested. */ | 1091 | /* Compute exact mode line heights, if requested. */ |
| 1092 | if (exact_mode_line_heights_p) | 1092 | if (exact_mode_line_heights_p) |
| 1093 | { | 1093 | { |
| @@ -1095,7 +1095,7 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) | |||
| 1095 | current_mode_line_height | 1095 | current_mode_line_height |
| 1096 | = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), | 1096 | = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), |
| 1097 | current_buffer->mode_line_format); | 1097 | current_buffer->mode_line_format); |
| 1098 | 1098 | ||
| 1099 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | 1099 | if (WINDOW_WANTS_HEADER_LINE_P (w)) |
| 1100 | current_header_line_height | 1100 | current_header_line_height |
| 1101 | = display_mode_line (w, HEADER_LINE_FACE_ID, | 1101 | = display_mode_line (w, HEADER_LINE_FACE_ID, |
| @@ -1112,7 +1112,7 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) | |||
| 1112 | int top_y = it.current_y; | 1112 | int top_y = it.current_y; |
| 1113 | int bottom_y = line_bottom_y (&it); | 1113 | int bottom_y = line_bottom_y (&it); |
| 1114 | int window_top_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); | 1114 | int window_top_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
| 1115 | 1115 | ||
| 1116 | if (top_y < window_top_y) | 1116 | if (top_y < window_top_y) |
| 1117 | visible_p = bottom_y > window_top_y; | 1117 | visible_p = bottom_y > window_top_y; |
| 1118 | else if (top_y < it.last_visible_y) | 1118 | else if (top_y < it.last_visible_y) |
| @@ -1258,7 +1258,7 @@ number_of_chars (s, multibyte_p) | |||
| 1258 | int multibyte_p; | 1258 | int multibyte_p; |
| 1259 | { | 1259 | { |
| 1260 | int nchars; | 1260 | int nchars; |
| 1261 | 1261 | ||
| 1262 | if (multibyte_p) | 1262 | if (multibyte_p) |
| 1263 | { | 1263 | { |
| 1264 | int rest = strlen (s), len; | 1264 | int rest = strlen (s), len; |
| @@ -1276,7 +1276,7 @@ number_of_chars (s, multibyte_p) | |||
| 1276 | return nchars; | 1276 | return nchars; |
| 1277 | } | 1277 | } |
| 1278 | 1278 | ||
| 1279 | 1279 | ||
| 1280 | /* Compute byte position NEWPOS->bytepos corresponding to | 1280 | /* Compute byte position NEWPOS->bytepos corresponding to |
| 1281 | NEWPOS->charpos. POS is a known position in string STRING. | 1281 | NEWPOS->charpos. POS is a known position in string STRING. |
| 1282 | NEWPOS->charpos must be >= POS.charpos. */ | 1282 | NEWPOS->charpos must be >= POS.charpos. */ |
| @@ -1288,7 +1288,7 @@ compute_string_pos (newpos, pos, string) | |||
| 1288 | { | 1288 | { |
| 1289 | xassert (STRINGP (string)); | 1289 | xassert (STRINGP (string)); |
| 1290 | xassert (CHARPOS (*newpos) >= CHARPOS (pos)); | 1290 | xassert (CHARPOS (*newpos) >= CHARPOS (pos)); |
| 1291 | 1291 | ||
| 1292 | if (STRING_MULTIBYTE (string)) | 1292 | if (STRING_MULTIBYTE (string)) |
| 1293 | *newpos = string_pos_nchars_ahead (pos, string, | 1293 | *newpos = string_pos_nchars_ahead (pos, string, |
| 1294 | CHARPOS (*newpos) - CHARPOS (pos)); | 1294 | CHARPOS (*newpos) - CHARPOS (pos)); |
| @@ -1321,7 +1321,7 @@ safe_eval (sexpr) | |||
| 1321 | Lisp_Object sexpr; | 1321 | Lisp_Object sexpr; |
| 1322 | { | 1322 | { |
| 1323 | Lisp_Object val; | 1323 | Lisp_Object val; |
| 1324 | 1324 | ||
| 1325 | if (inhibit_eval_during_redisplay) | 1325 | if (inhibit_eval_during_redisplay) |
| 1326 | val = Qnil; | 1326 | val = Qnil; |
| 1327 | else | 1327 | else |
| @@ -1338,7 +1338,7 @@ safe_eval (sexpr) | |||
| 1338 | UNGCPRO; | 1338 | UNGCPRO; |
| 1339 | val = unbind_to (count, val); | 1339 | val = unbind_to (count, val); |
| 1340 | } | 1340 | } |
| 1341 | 1341 | ||
| 1342 | return val; | 1342 | return val; |
| 1343 | } | 1343 | } |
| 1344 | 1344 | ||
| @@ -1353,7 +1353,7 @@ safe_call (nargs, args) | |||
| 1353 | Lisp_Object *args; | 1353 | Lisp_Object *args; |
| 1354 | { | 1354 | { |
| 1355 | Lisp_Object val; | 1355 | Lisp_Object val; |
| 1356 | 1356 | ||
| 1357 | if (inhibit_eval_during_redisplay) | 1357 | if (inhibit_eval_during_redisplay) |
| 1358 | val = Qnil; | 1358 | val = Qnil; |
| 1359 | else | 1359 | else |
| @@ -1478,7 +1478,7 @@ check_window_end (w) | |||
| 1478 | DEFAULT_FACE_ID for normal text, MODE_LINE_FACE_ID, | 1478 | DEFAULT_FACE_ID for normal text, MODE_LINE_FACE_ID, |
| 1479 | MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID for displaying | 1479 | MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID for displaying |
| 1480 | mode lines, or TOOL_BAR_FACE_ID for displaying the tool-bar. | 1480 | mode lines, or TOOL_BAR_FACE_ID for displaying the tool-bar. |
| 1481 | 1481 | ||
| 1482 | If ROW is null and BASE_FACE_ID is equal to MODE_LINE_FACE_ID, | 1482 | If ROW is null and BASE_FACE_ID is equal to MODE_LINE_FACE_ID, |
| 1483 | MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID, the iterator | 1483 | MODE_LINE_INACTIVE_FACE_ID, or HEADER_LINE_FACE_ID, the iterator |
| 1484 | will be initialized to use the corresponding mode line glyph row of | 1484 | will be initialized to use the corresponding mode line glyph row of |
| @@ -1518,7 +1518,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1518 | else if (base_face_id == HEADER_LINE_FACE_ID) | 1518 | else if (base_face_id == HEADER_LINE_FACE_ID) |
| 1519 | row = MATRIX_HEADER_LINE_ROW (w->desired_matrix); | 1519 | row = MATRIX_HEADER_LINE_ROW (w->desired_matrix); |
| 1520 | } | 1520 | } |
| 1521 | 1521 | ||
| 1522 | /* Clear IT. */ | 1522 | /* Clear IT. */ |
| 1523 | bzero (it, sizeof *it); | 1523 | bzero (it, sizeof *it); |
| 1524 | it->current.overlay_string_index = -1; | 1524 | it->current.overlay_string_index = -1; |
| @@ -1556,7 +1556,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1556 | /* Current value of the `space-width', and 'height' properties. */ | 1556 | /* Current value of the `space-width', and 'height' properties. */ |
| 1557 | it->space_width = Qnil; | 1557 | it->space_width = Qnil; |
| 1558 | it->font_height = Qnil; | 1558 | it->font_height = Qnil; |
| 1559 | 1559 | ||
| 1560 | /* Are control characters displayed as `^C'? */ | 1560 | /* Are control characters displayed as `^C'? */ |
| 1561 | it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow); | 1561 | it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow); |
| 1562 | 1562 | ||
| @@ -1565,7 +1565,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1565 | invisible. */ | 1565 | invisible. */ |
| 1566 | it->selective = (INTEGERP (current_buffer->selective_display) | 1566 | it->selective = (INTEGERP (current_buffer->selective_display) |
| 1567 | ? XFASTINT (current_buffer->selective_display) | 1567 | ? XFASTINT (current_buffer->selective_display) |
| 1568 | : (!NILP (current_buffer->selective_display) | 1568 | : (!NILP (current_buffer->selective_display) |
| 1569 | ? -1 : 0)); | 1569 | ? -1 : 0)); |
| 1570 | it->selective_display_ellipsis_p | 1570 | it->selective_display_ellipsis_p |
| 1571 | = !NILP (current_buffer->selective_display_ellipses); | 1571 | = !NILP (current_buffer->selective_display_ellipses); |
| @@ -1587,7 +1587,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1587 | -1 to indicate no region. */ | 1587 | -1 to indicate no region. */ |
| 1588 | if (highlight_region_p | 1588 | if (highlight_region_p |
| 1589 | /* Maybe highlight only in selected window. */ | 1589 | /* Maybe highlight only in selected window. */ |
| 1590 | && (/* Either show region everywhere. */ | 1590 | && (/* Either show region everywhere. */ |
| 1591 | highlight_nonselected_windows | 1591 | highlight_nonselected_windows |
| 1592 | /* Or show region in the selected window. */ | 1592 | /* Or show region in the selected window. */ |
| 1593 | || w == XWINDOW (selected_window) | 1593 | || w == XWINDOW (selected_window) |
| @@ -1703,7 +1703,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1703 | if (base_face_id != DEFAULT_FACE_ID) | 1703 | if (base_face_id != DEFAULT_FACE_ID) |
| 1704 | { | 1704 | { |
| 1705 | struct face *face; | 1705 | struct face *face; |
| 1706 | 1706 | ||
| 1707 | it->face_id = base_face_id; | 1707 | it->face_id = base_face_id; |
| 1708 | 1708 | ||
| 1709 | /* If we have a boxed mode line, make the first character appear | 1709 | /* If we have a boxed mode line, make the first character appear |
| @@ -1720,7 +1720,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1720 | it->end_charpos = ZV; | 1720 | it->end_charpos = ZV; |
| 1721 | it->face_id = -1; | 1721 | it->face_id = -1; |
| 1722 | IT_CHARPOS (*it) = charpos; | 1722 | IT_CHARPOS (*it) = charpos; |
| 1723 | 1723 | ||
| 1724 | /* Compute byte position if not specified. */ | 1724 | /* Compute byte position if not specified. */ |
| 1725 | if (bytepos < charpos) | 1725 | if (bytepos < charpos) |
| 1726 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos); | 1726 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos); |
| @@ -1730,7 +1730,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) | |||
| 1730 | /* Compute faces etc. */ | 1730 | /* Compute faces etc. */ |
| 1731 | reseat (it, it->current.pos, 1); | 1731 | reseat (it, it->current.pos, 1); |
| 1732 | } | 1732 | } |
| 1733 | 1733 | ||
| 1734 | CHECK_IT (it); | 1734 | CHECK_IT (it); |
| 1735 | } | 1735 | } |
| 1736 | 1736 | ||
| @@ -1753,7 +1753,7 @@ start_display (it, w, pos) | |||
| 1753 | { | 1753 | { |
| 1754 | int start_at_line_beg_p; | 1754 | int start_at_line_beg_p; |
| 1755 | int first_y = it->current_y; | 1755 | int first_y = it->current_y; |
| 1756 | 1756 | ||
| 1757 | /* If window start is not at a line start, skip forward to POS to | 1757 | /* If window start is not at a line start, skip forward to POS to |
| 1758 | get the correct continuation lines width. */ | 1758 | get the correct continuation lines width. */ |
| 1759 | start_at_line_beg_p = (CHARPOS (pos) == BEGV | 1759 | start_at_line_beg_p = (CHARPOS (pos) == BEGV |
| @@ -1777,7 +1777,7 @@ start_display (it, w, pos) | |||
| 1777 | set_iterator_to_next (it, 1); | 1777 | set_iterator_to_next (it, 1); |
| 1778 | move_it_in_display_line_to (it, -1, -1, 0); | 1778 | move_it_in_display_line_to (it, -1, -1, 0); |
| 1779 | } | 1779 | } |
| 1780 | 1780 | ||
| 1781 | it->continuation_lines_width += it->current_x; | 1781 | it->continuation_lines_width += it->current_x; |
| 1782 | } | 1782 | } |
| 1783 | 1783 | ||
| @@ -1786,7 +1786,7 @@ start_display (it, w, pos) | |||
| 1786 | fields in the iterator structure. */ | 1786 | fields in the iterator structure. */ |
| 1787 | it->max_ascent = it->max_descent = 0; | 1787 | it->max_ascent = it->max_descent = 0; |
| 1788 | it->max_phys_ascent = it->max_phys_descent = 0; | 1788 | it->max_phys_ascent = it->max_phys_descent = 0; |
| 1789 | 1789 | ||
| 1790 | it->current_y = first_y; | 1790 | it->current_y = first_y; |
| 1791 | it->vpos = 0; | 1791 | it->vpos = 0; |
| 1792 | it->current_x = it->hpos = 0; | 1792 | it->current_x = it->hpos = 0; |
| @@ -1796,7 +1796,7 @@ start_display (it, w, pos) | |||
| 1796 | #if 0 /* Don't assert the following because start_display is sometimes | 1796 | #if 0 /* Don't assert the following because start_display is sometimes |
| 1797 | called intentionally with a window start that is not at a | 1797 | called intentionally with a window start that is not at a |
| 1798 | line start. Please leave this code in as a comment. */ | 1798 | line start. Please leave this code in as a comment. */ |
| 1799 | 1799 | ||
| 1800 | /* Window start should be on a line start, now. */ | 1800 | /* Window start should be on a line start, now. */ |
| 1801 | xassert (it->continuation_lines_width | 1801 | xassert (it->continuation_lines_width |
| 1802 | || IT_CHARPOS (it) == BEGV | 1802 | || IT_CHARPOS (it) == BEGV |
| @@ -1816,7 +1816,7 @@ in_ellipses_for_invisible_text_p (pos, w) | |||
| 1816 | Lisp_Object prop, window; | 1816 | Lisp_Object prop, window; |
| 1817 | int ellipses_p = 0; | 1817 | int ellipses_p = 0; |
| 1818 | int charpos = CHARPOS (pos->pos); | 1818 | int charpos = CHARPOS (pos->pos); |
| 1819 | 1819 | ||
| 1820 | /* If POS specifies a position in a display vector, this might | 1820 | /* If POS specifies a position in a display vector, this might |
| 1821 | be for an ellipsis displayed for invisible text. We won't | 1821 | be for an ellipsis displayed for invisible text. We won't |
| 1822 | get the iterator set up for delivering that ellipsis unless | 1822 | get the iterator set up for delivering that ellipsis unless |
| @@ -1852,7 +1852,7 @@ init_from_display_pos (it, w, pos) | |||
| 1852 | { | 1852 | { |
| 1853 | int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos); | 1853 | int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos); |
| 1854 | int i, overlay_strings_with_newlines = 0; | 1854 | int i, overlay_strings_with_newlines = 0; |
| 1855 | 1855 | ||
| 1856 | /* If POS specifies a position in a display vector, this might | 1856 | /* If POS specifies a position in a display vector, this might |
| 1857 | be for an ellipsis displayed for invisible text. We won't | 1857 | be for an ellipsis displayed for invisible text. We won't |
| 1858 | get the iterator set up for delivering that ellipsis unless | 1858 | get the iterator set up for delivering that ellipsis unless |
| @@ -1862,7 +1862,7 @@ init_from_display_pos (it, w, pos) | |||
| 1862 | --charpos; | 1862 | --charpos; |
| 1863 | bytepos = 0; | 1863 | bytepos = 0; |
| 1864 | } | 1864 | } |
| 1865 | 1865 | ||
| 1866 | /* Keep in mind: the call to reseat in init_iterator skips invisible | 1866 | /* Keep in mind: the call to reseat in init_iterator skips invisible |
| 1867 | text, so we might end up at a position different from POS. This | 1867 | text, so we might end up at a position different from POS. This |
| 1868 | is only a problem when POS is a row start after a newline and an | 1868 | is only a problem when POS is a row start after a newline and an |
| @@ -1878,7 +1878,7 @@ init_from_display_pos (it, w, pos) | |||
| 1878 | { | 1878 | { |
| 1879 | char *s = SDATA (it->overlay_strings[i]); | 1879 | char *s = SDATA (it->overlay_strings[i]); |
| 1880 | char *e = s + SBYTES (it->overlay_strings[i]); | 1880 | char *e = s + SBYTES (it->overlay_strings[i]); |
| 1881 | 1881 | ||
| 1882 | while (s < e && *s != '\n') | 1882 | while (s < e && *s != '\n') |
| 1883 | ++s; | 1883 | ++s; |
| 1884 | 1884 | ||
| @@ -1901,7 +1901,7 @@ init_from_display_pos (it, w, pos) | |||
| 1901 | correct the overlay string index. */ | 1901 | correct the overlay string index. */ |
| 1902 | if (it->method == next_element_from_image) | 1902 | if (it->method == next_element_from_image) |
| 1903 | pop_it (it); | 1903 | pop_it (it); |
| 1904 | 1904 | ||
| 1905 | /* We already have the first chunk of overlay strings in | 1905 | /* We already have the first chunk of overlay strings in |
| 1906 | IT->overlay_strings. Load more until the one for | 1906 | IT->overlay_strings. Load more until the one for |
| 1907 | pos->overlay_string_index is in IT->overlay_strings. */ | 1907 | pos->overlay_string_index is in IT->overlay_strings. */ |
| @@ -1915,7 +1915,7 @@ init_from_display_pos (it, w, pos) | |||
| 1915 | it->current.overlay_string_index += OVERLAY_STRING_CHUNK_SIZE; | 1915 | it->current.overlay_string_index += OVERLAY_STRING_CHUNK_SIZE; |
| 1916 | } | 1916 | } |
| 1917 | } | 1917 | } |
| 1918 | 1918 | ||
| 1919 | it->current.overlay_string_index = pos->overlay_string_index; | 1919 | it->current.overlay_string_index = pos->overlay_string_index; |
| 1920 | relative_index = (it->current.overlay_string_index | 1920 | relative_index = (it->current.overlay_string_index |
| 1921 | % OVERLAY_STRING_CHUNK_SIZE); | 1921 | % OVERLAY_STRING_CHUNK_SIZE); |
| @@ -1924,7 +1924,7 @@ init_from_display_pos (it, w, pos) | |||
| 1924 | it->current.string_pos = pos->string_pos; | 1924 | it->current.string_pos = pos->string_pos; |
| 1925 | it->method = next_element_from_string; | 1925 | it->method = next_element_from_string; |
| 1926 | } | 1926 | } |
| 1927 | 1927 | ||
| 1928 | #if 0 /* This is bogus because POS not having an overlay string | 1928 | #if 0 /* This is bogus because POS not having an overlay string |
| 1929 | position does not mean it's after the string. Example: A | 1929 | position does not mean it's after the string. Example: A |
| 1930 | line starting with a before-string and initialization of IT | 1930 | line starting with a before-string and initialization of IT |
| @@ -1943,7 +1943,7 @@ init_from_display_pos (it, w, pos) | |||
| 1943 | it->overlay_strings_at_end_processed_p = 1; | 1943 | it->overlay_strings_at_end_processed_p = 1; |
| 1944 | } | 1944 | } |
| 1945 | #endif /* 0 */ | 1945 | #endif /* 0 */ |
| 1946 | 1946 | ||
| 1947 | if (CHARPOS (pos->string_pos) >= 0) | 1947 | if (CHARPOS (pos->string_pos) >= 0) |
| 1948 | { | 1948 | { |
| 1949 | /* Recorded position is not in an overlay string, but in another | 1949 | /* Recorded position is not in an overlay string, but in another |
| @@ -1962,7 +1962,7 @@ init_from_display_pos (it, w, pos) | |||
| 1962 | xassert (it->dpvec && it->current.dpvec_index == 0); | 1962 | xassert (it->dpvec && it->current.dpvec_index == 0); |
| 1963 | it->current.dpvec_index = pos->dpvec_index; | 1963 | it->current.dpvec_index = pos->dpvec_index; |
| 1964 | } | 1964 | } |
| 1965 | 1965 | ||
| 1966 | CHECK_IT (it); | 1966 | CHECK_IT (it); |
| 1967 | return !overlay_strings_with_newlines; | 1967 | return !overlay_strings_with_newlines; |
| 1968 | } | 1968 | } |
| @@ -1982,7 +1982,7 @@ init_to_row_start (it, w, row) | |||
| 1982 | CHECK_IT (it); | 1982 | CHECK_IT (it); |
| 1983 | } | 1983 | } |
| 1984 | 1984 | ||
| 1985 | 1985 | ||
| 1986 | /* Initialize IT for stepping through current_buffer in window W | 1986 | /* Initialize IT for stepping through current_buffer in window W |
| 1987 | starting in the line following ROW, i.e. starting at ROW->end. | 1987 | starting in the line following ROW, i.e. starting at ROW->end. |
| 1988 | Value is zero if there are overlay strings with newlines at ROW's | 1988 | Value is zero if there are overlay strings with newlines at ROW's |
| @@ -1995,7 +1995,7 @@ init_to_row_end (it, w, row) | |||
| 1995 | struct glyph_row *row; | 1995 | struct glyph_row *row; |
| 1996 | { | 1996 | { |
| 1997 | int success = 0; | 1997 | int success = 0; |
| 1998 | 1998 | ||
| 1999 | if (init_from_display_pos (it, w, &row->end)) | 1999 | if (init_from_display_pos (it, w, &row->end)) |
| 2000 | { | 2000 | { |
| 2001 | if (row->continued_p) | 2001 | if (row->continued_p) |
| @@ -2004,7 +2004,7 @@ init_to_row_end (it, w, row) | |||
| 2004 | CHECK_IT (it); | 2004 | CHECK_IT (it); |
| 2005 | success = 1; | 2005 | success = 1; |
| 2006 | } | 2006 | } |
| 2007 | 2007 | ||
| 2008 | return success; | 2008 | return success; |
| 2009 | } | 2009 | } |
| 2010 | 2010 | ||
| @@ -2033,7 +2033,7 @@ handle_stop (it) | |||
| 2033 | do | 2033 | do |
| 2034 | { | 2034 | { |
| 2035 | handled = HANDLED_NORMALLY; | 2035 | handled = HANDLED_NORMALLY; |
| 2036 | 2036 | ||
| 2037 | /* Call text property handlers. */ | 2037 | /* Call text property handlers. */ |
| 2038 | for (p = it_props; p->handler; ++p) | 2038 | for (p = it_props; p->handler; ++p) |
| 2039 | { | 2039 | { |
| @@ -2057,7 +2057,7 @@ handle_stop (it) | |||
| 2057 | /* Handle overlay changes. */ | 2057 | /* Handle overlay changes. */ |
| 2058 | if (handle_overlay_change_p) | 2058 | if (handle_overlay_change_p) |
| 2059 | handled = handle_overlay_change (it); | 2059 | handled = handle_overlay_change (it); |
| 2060 | 2060 | ||
| 2061 | /* Determine where to stop next. */ | 2061 | /* Determine where to stop next. */ |
| 2062 | if (handled == HANDLED_NORMALLY) | 2062 | if (handled == HANDLED_NORMALLY) |
| 2063 | compute_stop_pos (it); | 2063 | compute_stop_pos (it); |
| @@ -2079,7 +2079,7 @@ compute_stop_pos (it) | |||
| 2079 | 2079 | ||
| 2080 | /* If nowhere else, stop at the end. */ | 2080 | /* If nowhere else, stop at the end. */ |
| 2081 | it->stop_charpos = it->end_charpos; | 2081 | it->stop_charpos = it->end_charpos; |
| 2082 | 2082 | ||
| 2083 | if (STRINGP (it->string)) | 2083 | if (STRINGP (it->string)) |
| 2084 | { | 2084 | { |
| 2085 | /* Strings are usually short, so don't limit the search for | 2085 | /* Strings are usually short, so don't limit the search for |
| @@ -2109,7 +2109,7 @@ compute_stop_pos (it) | |||
| 2109 | else if (IT_CHARPOS (*it) < it->region_end_charpos) | 2109 | else if (IT_CHARPOS (*it) < it->region_end_charpos) |
| 2110 | it->stop_charpos = min (it->stop_charpos, it->region_end_charpos); | 2110 | it->stop_charpos = min (it->stop_charpos, it->region_end_charpos); |
| 2111 | } | 2111 | } |
| 2112 | 2112 | ||
| 2113 | /* Set up variables for computing the stop position from text | 2113 | /* Set up variables for computing the stop position from text |
| 2114 | property changes. */ | 2114 | property changes. */ |
| 2115 | XSETBUFFER (object, current_buffer); | 2115 | XSETBUFFER (object, current_buffer); |
| @@ -2146,7 +2146,7 @@ compute_stop_pos (it) | |||
| 2146 | if (!EQ (values_here[p->idx], new_value)) | 2146 | if (!EQ (values_here[p->idx], new_value)) |
| 2147 | break; | 2147 | break; |
| 2148 | } | 2148 | } |
| 2149 | 2149 | ||
| 2150 | if (p->handler) | 2150 | if (p->handler) |
| 2151 | break; | 2151 | break; |
| 2152 | } | 2152 | } |
| @@ -2244,7 +2244,7 @@ handle_fontified_prop (it) | |||
| 2244 | 2244 | ||
| 2245 | val = Vfontification_functions; | 2245 | val = Vfontification_functions; |
| 2246 | specbind (Qfontification_functions, Qnil); | 2246 | specbind (Qfontification_functions, Qnil); |
| 2247 | 2247 | ||
| 2248 | if (!CONSP (val) || EQ (XCAR (val), Qlambda)) | 2248 | if (!CONSP (val) || EQ (XCAR (val), Qlambda)) |
| 2249 | safe_call1 (val, pos); | 2249 | safe_call1 (val, pos); |
| 2250 | else | 2250 | else |
| @@ -2254,11 +2254,11 @@ handle_fontified_prop (it) | |||
| 2254 | 2254 | ||
| 2255 | globals = Qnil; | 2255 | globals = Qnil; |
| 2256 | GCPRO2 (val, globals); | 2256 | GCPRO2 (val, globals); |
| 2257 | 2257 | ||
| 2258 | for (; CONSP (val); val = XCDR (val)) | 2258 | for (; CONSP (val); val = XCDR (val)) |
| 2259 | { | 2259 | { |
| 2260 | fn = XCAR (val); | 2260 | fn = XCAR (val); |
| 2261 | 2261 | ||
| 2262 | if (EQ (fn, Qt)) | 2262 | if (EQ (fn, Qt)) |
| 2263 | { | 2263 | { |
| 2264 | /* A value of t indicates this hook has a local | 2264 | /* A value of t indicates this hook has a local |
| @@ -2308,7 +2308,7 @@ handle_face_prop (it) | |||
| 2308 | struct it *it; | 2308 | struct it *it; |
| 2309 | { | 2309 | { |
| 2310 | int new_face_id, next_stop; | 2310 | int new_face_id, next_stop; |
| 2311 | 2311 | ||
| 2312 | if (!STRINGP (it->string)) | 2312 | if (!STRINGP (it->string)) |
| 2313 | { | 2313 | { |
| 2314 | new_face_id | 2314 | new_face_id |
| @@ -2320,7 +2320,7 @@ handle_face_prop (it) | |||
| 2320 | (IT_CHARPOS (*it) | 2320 | (IT_CHARPOS (*it) |
| 2321 | + TEXT_PROP_DISTANCE_LIMIT), | 2321 | + TEXT_PROP_DISTANCE_LIMIT), |
| 2322 | 0); | 2322 | 0); |
| 2323 | 2323 | ||
| 2324 | /* Is this a start of a run of characters with box face? | 2324 | /* Is this a start of a run of characters with box face? |
| 2325 | Caveat: this can be called for a freshly initialized | 2325 | Caveat: this can be called for a freshly initialized |
| 2326 | iterator; face_id is -1 in this case. We know that the new | 2326 | iterator; face_id is -1 in this case. We know that the new |
| @@ -2330,7 +2330,7 @@ handle_face_prop (it) | |||
| 2330 | if (new_face_id != it->face_id) | 2330 | if (new_face_id != it->face_id) |
| 2331 | { | 2331 | { |
| 2332 | struct face *new_face = FACE_FROM_ID (it->f, new_face_id); | 2332 | struct face *new_face = FACE_FROM_ID (it->f, new_face_id); |
| 2333 | 2333 | ||
| 2334 | /* If new face has a box but old face has not, this is | 2334 | /* If new face has a box but old face has not, this is |
| 2335 | the start of a run of characters with box, i.e. it has | 2335 | the start of a run of characters with box, i.e. it has |
| 2336 | a shadow on the left side. The value of face_id of the | 2336 | a shadow on the left side. The value of face_id of the |
| @@ -2353,14 +2353,14 @@ handle_face_prop (it) | |||
| 2353 | bufpos = IT_CHARPOS (*it); | 2353 | bufpos = IT_CHARPOS (*it); |
| 2354 | else | 2354 | else |
| 2355 | bufpos = 0; | 2355 | bufpos = 0; |
| 2356 | 2356 | ||
| 2357 | /* For strings from a buffer, i.e. overlay strings or strings | 2357 | /* For strings from a buffer, i.e. overlay strings or strings |
| 2358 | from a `display' property, use the face at IT's current | 2358 | from a `display' property, use the face at IT's current |
| 2359 | buffer position as the base face to merge with, so that | 2359 | buffer position as the base face to merge with, so that |
| 2360 | overlay strings appear in the same face as surrounding | 2360 | overlay strings appear in the same face as surrounding |
| 2361 | text, unless they specify their own faces. */ | 2361 | text, unless they specify their own faces. */ |
| 2362 | base_face_id = underlying_face_id (it); | 2362 | base_face_id = underlying_face_id (it); |
| 2363 | 2363 | ||
| 2364 | new_face_id = face_at_string_position (it->w, | 2364 | new_face_id = face_at_string_position (it->w, |
| 2365 | it->string, | 2365 | it->string, |
| 2366 | IT_STRING_CHARPOS (*it), | 2366 | IT_STRING_CHARPOS (*it), |
| @@ -2369,7 +2369,7 @@ handle_face_prop (it) | |||
| 2369 | it->region_end_charpos, | 2369 | it->region_end_charpos, |
| 2370 | &next_stop, | 2370 | &next_stop, |
| 2371 | base_face_id, 0); | 2371 | base_face_id, 0); |
| 2372 | 2372 | ||
| 2373 | #if 0 /* This shouldn't be neccessary. Let's check it. */ | 2373 | #if 0 /* This shouldn't be neccessary. Let's check it. */ |
| 2374 | /* If IT is used to display a mode line we would really like to | 2374 | /* If IT is used to display a mode line we would really like to |
| 2375 | use the mode line face instead of the frame's default face. */ | 2375 | use the mode line face instead of the frame's default face. */ |
| @@ -2377,7 +2377,7 @@ handle_face_prop (it) | |||
| 2377 | && new_face_id == DEFAULT_FACE_ID) | 2377 | && new_face_id == DEFAULT_FACE_ID) |
| 2378 | new_face_id = CURRENT_MODE_LINE_FACE_ID (it->w); | 2378 | new_face_id = CURRENT_MODE_LINE_FACE_ID (it->w); |
| 2379 | #endif | 2379 | #endif |
| 2380 | 2380 | ||
| 2381 | /* Is this a start of a run of characters with box? Caveat: | 2381 | /* Is this a start of a run of characters with box? Caveat: |
| 2382 | this can be called for a freshly allocated iterator; face_id | 2382 | this can be called for a freshly allocated iterator; face_id |
| 2383 | is -1 is this case. We know that the new face will not | 2383 | is -1 is this case. We know that the new face will not |
| @@ -2389,7 +2389,7 @@ handle_face_prop (it) | |||
| 2389 | { | 2389 | { |
| 2390 | struct face *new_face = FACE_FROM_ID (it->f, new_face_id); | 2390 | struct face *new_face = FACE_FROM_ID (it->f, new_face_id); |
| 2391 | struct face *old_face = FACE_FROM_ID (it->f, it->face_id); | 2391 | struct face *old_face = FACE_FROM_ID (it->f, it->face_id); |
| 2392 | 2392 | ||
| 2393 | /* If new face has a box but old face hasn't, this is the | 2393 | /* If new face has a box but old face hasn't, this is the |
| 2394 | start of a run of characters with box, i.e. it has a | 2394 | start of a run of characters with box, i.e. it has a |
| 2395 | shadow on the left side. */ | 2395 | shadow on the left side. */ |
| @@ -2398,7 +2398,7 @@ handle_face_prop (it) | |||
| 2398 | it->face_box_p = new_face->box != FACE_NO_BOX; | 2398 | it->face_box_p = new_face->box != FACE_NO_BOX; |
| 2399 | } | 2399 | } |
| 2400 | } | 2400 | } |
| 2401 | 2401 | ||
| 2402 | it->face_id = new_face_id; | 2402 | it->face_id = new_face_id; |
| 2403 | return HANDLED_NORMALLY; | 2403 | return HANDLED_NORMALLY; |
| 2404 | } | 2404 | } |
| @@ -2439,11 +2439,11 @@ face_before_or_after_it_pos (it, before_p) | |||
| 2439 | struct text_pos pos; | 2439 | struct text_pos pos; |
| 2440 | 2440 | ||
| 2441 | xassert (it->s == NULL); | 2441 | xassert (it->s == NULL); |
| 2442 | 2442 | ||
| 2443 | if (STRINGP (it->string)) | 2443 | if (STRINGP (it->string)) |
| 2444 | { | 2444 | { |
| 2445 | int bufpos, base_face_id; | 2445 | int bufpos, base_face_id; |
| 2446 | 2446 | ||
| 2447 | /* No face change past the end of the string (for the case | 2447 | /* No face change past the end of the string (for the case |
| 2448 | we are padding with spaces). No face change before the | 2448 | we are padding with spaces). No face change before the |
| 2449 | string start. */ | 2449 | string start. */ |
| @@ -2487,7 +2487,7 @@ face_before_or_after_it_pos (it, before_p) | |||
| 2487 | int rest = SBYTES (it->string) - BYTEPOS (pos); | 2487 | int rest = SBYTES (it->string) - BYTEPOS (pos); |
| 2488 | int c, len; | 2488 | int c, len; |
| 2489 | struct face *face = FACE_FROM_ID (it->f, face_id); | 2489 | struct face *face = FACE_FROM_ID (it->f, face_id); |
| 2490 | 2490 | ||
| 2491 | c = string_char_and_length (p, rest, &len); | 2491 | c = string_char_and_length (p, rest, &len); |
| 2492 | face_id = FACE_FOR_CHAR (it->f, face, c); | 2492 | face_id = FACE_FOR_CHAR (it->f, face, c); |
| 2493 | } | 2493 | } |
| @@ -2497,10 +2497,10 @@ face_before_or_after_it_pos (it, before_p) | |||
| 2497 | if ((IT_CHARPOS (*it) >= ZV && !before_p) | 2497 | if ((IT_CHARPOS (*it) >= ZV && !before_p) |
| 2498 | || (IT_CHARPOS (*it) <= BEGV && before_p)) | 2498 | || (IT_CHARPOS (*it) <= BEGV && before_p)) |
| 2499 | return it->face_id; | 2499 | return it->face_id; |
| 2500 | 2500 | ||
| 2501 | limit = IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT; | 2501 | limit = IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT; |
| 2502 | pos = it->current.pos; | 2502 | pos = it->current.pos; |
| 2503 | 2503 | ||
| 2504 | if (before_p) | 2504 | if (before_p) |
| 2505 | DEC_TEXT_POS (pos, it->multibyte_p); | 2505 | DEC_TEXT_POS (pos, it->multibyte_p); |
| 2506 | else | 2506 | else |
| @@ -2512,7 +2512,7 @@ face_before_or_after_it_pos (it, before_p) | |||
| 2512 | else | 2512 | else |
| 2513 | INC_TEXT_POS (pos, it->multibyte_p); | 2513 | INC_TEXT_POS (pos, it->multibyte_p); |
| 2514 | } | 2514 | } |
| 2515 | 2515 | ||
| 2516 | /* Determine face for CHARSET_ASCII, or unibyte. */ | 2516 | /* Determine face for CHARSET_ASCII, or unibyte. */ |
| 2517 | face_id = face_at_buffer_position (it->w, | 2517 | face_id = face_at_buffer_position (it->w, |
| 2518 | CHARPOS (pos), | 2518 | CHARPOS (pos), |
| @@ -2531,7 +2531,7 @@ face_before_or_after_it_pos (it, before_p) | |||
| 2531 | face_id = FACE_FOR_CHAR (it->f, face, c); | 2531 | face_id = FACE_FOR_CHAR (it->f, face, c); |
| 2532 | } | 2532 | } |
| 2533 | } | 2533 | } |
| 2534 | 2534 | ||
| 2535 | return face_id; | 2535 | return face_id; |
| 2536 | } | 2536 | } |
| 2537 | 2537 | ||
| @@ -2565,7 +2565,7 @@ handle_invisible_prop (it) | |||
| 2565 | && IT_STRING_CHARPOS (*it) < it->end_charpos) | 2565 | && IT_STRING_CHARPOS (*it) < it->end_charpos) |
| 2566 | { | 2566 | { |
| 2567 | handled = HANDLED_RECOMPUTE_PROPS; | 2567 | handled = HANDLED_RECOMPUTE_PROPS; |
| 2568 | 2568 | ||
| 2569 | /* Get the position at which the next change of the | 2569 | /* Get the position at which the next change of the |
| 2570 | invisible text property can be found in IT->string. | 2570 | invisible text property can be found in IT->string. |
| 2571 | Value will be nil if the property value is the same for | 2571 | Value will be nil if the property value is the same for |
| @@ -2573,7 +2573,7 @@ handle_invisible_prop (it) | |||
| 2573 | XSETINT (limit, SCHARS (it->string)); | 2573 | XSETINT (limit, SCHARS (it->string)); |
| 2574 | end_charpos = Fnext_single_property_change (charpos, Qinvisible, | 2574 | end_charpos = Fnext_single_property_change (charpos, Qinvisible, |
| 2575 | it->string, limit); | 2575 | it->string, limit); |
| 2576 | 2576 | ||
| 2577 | /* Text at current position is invisible. The next | 2577 | /* Text at current position is invisible. The next |
| 2578 | change in the property is at position end_charpos. | 2578 | change in the property is at position end_charpos. |
| 2579 | Move IT's current position to that position. */ | 2579 | Move IT's current position to that position. */ |
| @@ -2625,7 +2625,7 @@ handle_invisible_prop (it) | |||
| 2625 | int display_ellipsis_p = invis_p == 2; | 2625 | int display_ellipsis_p = invis_p == 2; |
| 2626 | 2626 | ||
| 2627 | handled = HANDLED_RECOMPUTE_PROPS; | 2627 | handled = HANDLED_RECOMPUTE_PROPS; |
| 2628 | 2628 | ||
| 2629 | /* Loop skipping over invisible text. The loop is left at | 2629 | /* Loop skipping over invisible text. The loop is left at |
| 2630 | ZV or with IT on the first char being visible again. */ | 2630 | ZV or with IT on the first char being visible again. */ |
| 2631 | do | 2631 | do |
| @@ -2655,7 +2655,7 @@ handle_invisible_prop (it) | |||
| 2655 | prop = Fget_char_property (pos, Qinvisible, it->window); | 2655 | prop = Fget_char_property (pos, Qinvisible, it->window); |
| 2656 | invis_p = TEXT_PROP_MEANS_INVISIBLE (prop); | 2656 | invis_p = TEXT_PROP_MEANS_INVISIBLE (prop); |
| 2657 | } | 2657 | } |
| 2658 | 2658 | ||
| 2659 | /* If we ended up on invisible text, proceed to | 2659 | /* If we ended up on invisible text, proceed to |
| 2660 | skip starting with next_stop. */ | 2660 | skip starting with next_stop. */ |
| 2661 | if (invis_p) | 2661 | if (invis_p) |
| @@ -2666,7 +2666,7 @@ handle_invisible_prop (it) | |||
| 2666 | /* The position newpos is now either ZV or on visible text. */ | 2666 | /* The position newpos is now either ZV or on visible text. */ |
| 2667 | IT_CHARPOS (*it) = newpos; | 2667 | IT_CHARPOS (*it) = newpos; |
| 2668 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos); | 2668 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos); |
| 2669 | 2669 | ||
| 2670 | /* If there are before-strings at the start of invisible | 2670 | /* If there are before-strings at the start of invisible |
| 2671 | text, and the text is invisible because of a text | 2671 | text, and the text is invisible because of a text |
| 2672 | property, arrange to show before-strings because 20.x did | 2672 | property, arrange to show before-strings because 20.x did |
| @@ -2694,25 +2694,25 @@ static void | |||
| 2694 | setup_for_ellipsis (it) | 2694 | setup_for_ellipsis (it) |
| 2695 | struct it *it; | 2695 | struct it *it; |
| 2696 | { | 2696 | { |
| 2697 | if (it->dp | 2697 | if (it->dp |
| 2698 | && VECTORP (DISP_INVIS_VECTOR (it->dp))) | 2698 | && VECTORP (DISP_INVIS_VECTOR (it->dp))) |
| 2699 | { | 2699 | { |
| 2700 | struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); | 2700 | struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp)); |
| 2701 | it->dpvec = v->contents; | 2701 | it->dpvec = v->contents; |
| 2702 | it->dpend = v->contents + v->size; | 2702 | it->dpend = v->contents + v->size; |
| 2703 | } | 2703 | } |
| 2704 | else | 2704 | else |
| 2705 | { | 2705 | { |
| 2706 | /* Default `...'. */ | 2706 | /* Default `...'. */ |
| 2707 | it->dpvec = default_invis_vector; | 2707 | it->dpvec = default_invis_vector; |
| 2708 | it->dpend = default_invis_vector + 3; | 2708 | it->dpend = default_invis_vector + 3; |
| 2709 | } | 2709 | } |
| 2710 | 2710 | ||
| 2711 | /* The ellipsis display does not replace the display of the | 2711 | /* The ellipsis display does not replace the display of the |
| 2712 | character at the new position. Indicate this by setting | 2712 | character at the new position. Indicate this by setting |
| 2713 | IT->dpvec_char_len to zero. */ | 2713 | IT->dpvec_char_len to zero. */ |
| 2714 | it->dpvec_char_len = 0; | 2714 | it->dpvec_char_len = 0; |
| 2715 | 2715 | ||
| 2716 | it->current.dpvec_index = 0; | 2716 | it->current.dpvec_index = 0; |
| 2717 | it->method = next_element_from_display_vector; | 2717 | it->method = next_element_from_display_vector; |
| 2718 | } | 2718 | } |
| @@ -2879,7 +2879,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2879 | UNGCPRO; | 2879 | UNGCPRO; |
| 2880 | unbind_to (count, Qnil); | 2880 | unbind_to (count, Qnil); |
| 2881 | } | 2881 | } |
| 2882 | 2882 | ||
| 2883 | if (NILP (form)) | 2883 | if (NILP (form)) |
| 2884 | return 0; | 2884 | return 0; |
| 2885 | 2885 | ||
| @@ -2889,7 +2889,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2889 | { | 2889 | { |
| 2890 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) | 2890 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) |
| 2891 | return 0; | 2891 | return 0; |
| 2892 | 2892 | ||
| 2893 | /* `(height HEIGHT)'. */ | 2893 | /* `(height HEIGHT)'. */ |
| 2894 | it->font_height = XCAR (XCDR (prop)); | 2894 | it->font_height = XCAR (XCDR (prop)); |
| 2895 | if (!NILP (it->font_height)) | 2895 | if (!NILP (it->font_height)) |
| @@ -2923,7 +2923,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2923 | { | 2923 | { |
| 2924 | /* Value is a multiple of the canonical char height. */ | 2924 | /* Value is a multiple of the canonical char height. */ |
| 2925 | struct face *face; | 2925 | struct face *face; |
| 2926 | 2926 | ||
| 2927 | face = FACE_FROM_ID (it->f, DEFAULT_FACE_ID); | 2927 | face = FACE_FROM_ID (it->f, DEFAULT_FACE_ID); |
| 2928 | new_height = (XFLOATINT (it->font_height) | 2928 | new_height = (XFLOATINT (it->font_height) |
| 2929 | * XINT (face->lface[LFACE_HEIGHT_INDEX])); | 2929 | * XINT (face->lface[LFACE_HEIGHT_INDEX])); |
| @@ -2934,15 +2934,15 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2934 | current specified height to get the new height. */ | 2934 | current specified height to get the new height. */ |
| 2935 | Lisp_Object value; | 2935 | Lisp_Object value; |
| 2936 | int count = BINDING_STACK_SIZE (); | 2936 | int count = BINDING_STACK_SIZE (); |
| 2937 | 2937 | ||
| 2938 | specbind (Qheight, face->lface[LFACE_HEIGHT_INDEX]); | 2938 | specbind (Qheight, face->lface[LFACE_HEIGHT_INDEX]); |
| 2939 | value = safe_eval (it->font_height); | 2939 | value = safe_eval (it->font_height); |
| 2940 | unbind_to (count, Qnil); | 2940 | unbind_to (count, Qnil); |
| 2941 | 2941 | ||
| 2942 | if (NUMBERP (value)) | 2942 | if (NUMBERP (value)) |
| 2943 | new_height = XFLOATINT (value); | 2943 | new_height = XFLOATINT (value); |
| 2944 | } | 2944 | } |
| 2945 | 2945 | ||
| 2946 | if (new_height > 0) | 2946 | if (new_height > 0) |
| 2947 | it->face_id = face_with_height (it->f, it->face_id, new_height); | 2947 | it->face_id = face_with_height (it->f, it->face_id, new_height); |
| 2948 | } | 2948 | } |
| @@ -2954,7 +2954,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2954 | /* `(space_width WIDTH)'. */ | 2954 | /* `(space_width WIDTH)'. */ |
| 2955 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) | 2955 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) |
| 2956 | return 0; | 2956 | return 0; |
| 2957 | 2957 | ||
| 2958 | value = XCAR (XCDR (prop)); | 2958 | value = XCAR (XCDR (prop)); |
| 2959 | if (NUMBERP (value) && XFLOATINT (value) > 0) | 2959 | if (NUMBERP (value) && XFLOATINT (value) > 0) |
| 2960 | it->space_width = value; | 2960 | it->space_width = value; |
| @@ -2966,7 +2966,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2966 | /* `(raise FACTOR)'. */ | 2966 | /* `(raise FACTOR)'. */ |
| 2967 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) | 2967 | if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) |
| 2968 | return 0; | 2968 | return 0; |
| 2969 | 2969 | ||
| 2970 | #ifdef HAVE_WINDOW_SYSTEM | 2970 | #ifdef HAVE_WINDOW_SYSTEM |
| 2971 | value = XCAR (XCDR (prop)); | 2971 | value = XCAR (XCDR (prop)); |
| 2972 | if (NUMBERP (value)) | 2972 | if (NUMBERP (value)) |
| @@ -2999,7 +2999,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 2999 | if (CONSP (prop) && CONSP (XCAR (prop))) | 2999 | if (CONSP (prop) && CONSP (XCAR (prop))) |
| 3000 | { | 3000 | { |
| 3001 | Lisp_Object tem; | 3001 | Lisp_Object tem; |
| 3002 | 3002 | ||
| 3003 | value = XCDR (prop); | 3003 | value = XCDR (prop); |
| 3004 | if (CONSP (value)) | 3004 | if (CONSP (value)) |
| 3005 | value = XCAR (value); | 3005 | value = XCAR (value); |
| @@ -3030,7 +3030,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3030 | #else /* not HAVE_WINDOW_SYSTEM */ | 3030 | #else /* not HAVE_WINDOW_SYSTEM */ |
| 3031 | valid_p = STRINGP (value); | 3031 | valid_p = STRINGP (value); |
| 3032 | #endif /* not HAVE_WINDOW_SYSTEM */ | 3032 | #endif /* not HAVE_WINDOW_SYSTEM */ |
| 3033 | 3033 | ||
| 3034 | if ((EQ (location, Qleft_margin) | 3034 | if ((EQ (location, Qleft_margin) |
| 3035 | || EQ (location, Qright_margin) | 3035 | || EQ (location, Qright_margin) |
| 3036 | || NILP (location)) | 3036 | || NILP (location)) |
| @@ -3038,18 +3038,18 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3038 | && !display_replaced_before_p) | 3038 | && !display_replaced_before_p) |
| 3039 | { | 3039 | { |
| 3040 | replaces_text_display_p = 1; | 3040 | replaces_text_display_p = 1; |
| 3041 | 3041 | ||
| 3042 | /* Save current settings of IT so that we can restore them | 3042 | /* Save current settings of IT so that we can restore them |
| 3043 | when we are finished with the glyph property value. */ | 3043 | when we are finished with the glyph property value. */ |
| 3044 | push_it (it); | 3044 | push_it (it); |
| 3045 | 3045 | ||
| 3046 | if (NILP (location)) | 3046 | if (NILP (location)) |
| 3047 | it->area = TEXT_AREA; | 3047 | it->area = TEXT_AREA; |
| 3048 | else if (EQ (location, Qleft_margin)) | 3048 | else if (EQ (location, Qleft_margin)) |
| 3049 | it->area = LEFT_MARGIN_AREA; | 3049 | it->area = LEFT_MARGIN_AREA; |
| 3050 | else | 3050 | else |
| 3051 | it->area = RIGHT_MARGIN_AREA; | 3051 | it->area = RIGHT_MARGIN_AREA; |
| 3052 | 3052 | ||
| 3053 | if (STRINGP (value)) | 3053 | if (STRINGP (value)) |
| 3054 | { | 3054 | { |
| 3055 | it->string = value; | 3055 | it->string = value; |
| @@ -3079,7 +3079,7 @@ handle_single_display_prop (it, prop, object, position, | |||
| 3079 | it->position = start_pos; | 3079 | it->position = start_pos; |
| 3080 | it->object = NILP (object) ? it->w->buffer : object; | 3080 | it->object = NILP (object) ? it->w->buffer : object; |
| 3081 | it->method = next_element_from_image; | 3081 | it->method = next_element_from_image; |
| 3082 | 3082 | ||
| 3083 | /* Say that we haven't consumed the characters with | 3083 | /* Say that we haven't consumed the characters with |
| 3084 | `display' property yet. The call to pop_it in | 3084 | `display' property yet. The call to pop_it in |
| 3085 | set_iterator_to_next will clean this up. */ | 3085 | set_iterator_to_next will clean this up. */ |
| @@ -3130,7 +3130,7 @@ single_display_prop_intangible_p (prop) | |||
| 3130 | || EQ (XCAR (prop), Qright_margin)) | 3130 | || EQ (XCAR (prop), Qright_margin)) |
| 3131 | return 0; | 3131 | return 0; |
| 3132 | } | 3132 | } |
| 3133 | 3133 | ||
| 3134 | return CONSP (prop) && EQ (XCAR (prop), Qimage); | 3134 | return CONSP (prop) && EQ (XCAR (prop), Qimage); |
| 3135 | } | 3135 | } |
| 3136 | 3136 | ||
| @@ -3177,7 +3177,7 @@ single_display_prop_string_p (prop, string) | |||
| 3177 | { | 3177 | { |
| 3178 | if (EQ (string, prop)) | 3178 | if (EQ (string, prop)) |
| 3179 | return 1; | 3179 | return 1; |
| 3180 | 3180 | ||
| 3181 | /* Skip over `when FORM'. */ | 3181 | /* Skip over `when FORM'. */ |
| 3182 | if (CONSP (prop) && EQ (XCAR (prop), Qwhen)) | 3182 | if (CONSP (prop) && EQ (XCAR (prop), Qwhen)) |
| 3183 | { | 3183 | { |
| @@ -3199,7 +3199,7 @@ single_display_prop_string_p (prop, string) | |||
| 3199 | if (!CONSP (prop)) | 3199 | if (!CONSP (prop)) |
| 3200 | return 0; | 3200 | return 0; |
| 3201 | } | 3201 | } |
| 3202 | 3202 | ||
| 3203 | return CONSP (prop) && EQ (XCAR (prop), string); | 3203 | return CONSP (prop) && EQ (XCAR (prop), string); |
| 3204 | } | 3204 | } |
| 3205 | 3205 | ||
| @@ -3384,7 +3384,7 @@ handle_overlay_change (it) | |||
| 3384 | overlay strings to display, IT->string and | 3384 | overlay strings to display, IT->string and |
| 3385 | IT->current.overlay_string_index are set appropriately here. | 3385 | IT->current.overlay_string_index are set appropriately here. |
| 3386 | Otherwise IT->string is set to nil. */ | 3386 | Otherwise IT->string is set to nil. */ |
| 3387 | 3387 | ||
| 3388 | static void | 3388 | static void |
| 3389 | next_overlay_string (it) | 3389 | next_overlay_string (it) |
| 3390 | struct it *it; | 3390 | struct it *it; |
| @@ -3396,7 +3396,7 @@ next_overlay_string (it) | |||
| 3396 | they were before overlay strings were processed, and | 3396 | they were before overlay strings were processed, and |
| 3397 | continue to deliver from current_buffer. */ | 3397 | continue to deliver from current_buffer. */ |
| 3398 | int display_ellipsis_p = it->stack[it->sp - 1].display_ellipsis_p; | 3398 | int display_ellipsis_p = it->stack[it->sp - 1].display_ellipsis_p; |
| 3399 | 3399 | ||
| 3400 | pop_it (it); | 3400 | pop_it (it); |
| 3401 | xassert (it->stop_charpos >= BEGV | 3401 | xassert (it->stop_charpos >= BEGV |
| 3402 | && it->stop_charpos <= it->end_charpos); | 3402 | && it->stop_charpos <= it->end_charpos); |
| @@ -3424,7 +3424,7 @@ next_overlay_string (it) | |||
| 3424 | where we must load IT->overlay_strings with more strings, do | 3424 | where we must load IT->overlay_strings with more strings, do |
| 3425 | it. */ | 3425 | it. */ |
| 3426 | int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE; | 3426 | int i = it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE; |
| 3427 | 3427 | ||
| 3428 | if (it->current.overlay_string_index && i == 0) | 3428 | if (it->current.overlay_string_index && i == 0) |
| 3429 | load_overlay_strings (it, 0); | 3429 | load_overlay_strings (it, 0); |
| 3430 | 3430 | ||
| @@ -3436,7 +3436,7 @@ next_overlay_string (it) | |||
| 3436 | it->method = next_element_from_string; | 3436 | it->method = next_element_from_string; |
| 3437 | it->stop_charpos = 0; | 3437 | it->stop_charpos = 0; |
| 3438 | } | 3438 | } |
| 3439 | 3439 | ||
| 3440 | CHECK_IT (it); | 3440 | CHECK_IT (it); |
| 3441 | } | 3441 | } |
| 3442 | 3442 | ||
| @@ -3447,7 +3447,7 @@ next_overlay_string (it) | |||
| 3447 | 3447 | ||
| 3448 | 1. All after-strings come in front of before-strings, except | 3448 | 1. All after-strings come in front of before-strings, except |
| 3449 | when they come from the same overlay. | 3449 | when they come from the same overlay. |
| 3450 | 3450 | ||
| 3451 | 2. Within after-strings, strings are sorted so that overlay strings | 3451 | 2. Within after-strings, strings are sorted so that overlay strings |
| 3452 | from overlays with higher priorities come first. | 3452 | from overlays with higher priorities come first. |
| 3453 | 3453 | ||
| @@ -3456,7 +3456,7 @@ next_overlay_string (it) | |||
| 3456 | 3456 | ||
| 3457 | Value is analogous to strcmp. */ | 3457 | Value is analogous to strcmp. */ |
| 3458 | 3458 | ||
| 3459 | 3459 | ||
| 3460 | static int | 3460 | static int |
| 3461 | compare_overlay_entries (e1, e2) | 3461 | compare_overlay_entries (e1, e2) |
| 3462 | void *e1, *e2; | 3462 | void *e1, *e2; |
| @@ -3508,7 +3508,7 @@ compare_overlay_entries (e1, e2) | |||
| 3508 | front of before-string strings. Within before and after-strings, | 3508 | front of before-string strings. Within before and after-strings, |
| 3509 | strings are sorted by overlay priority. See also function | 3509 | strings are sorted by overlay priority. See also function |
| 3510 | compare_overlay_entries. */ | 3510 | compare_overlay_entries. */ |
| 3511 | 3511 | ||
| 3512 | static void | 3512 | static void |
| 3513 | load_overlay_strings (it, charpos) | 3513 | load_overlay_strings (it, charpos) |
| 3514 | struct it *it; | 3514 | struct it *it; |
| @@ -3561,7 +3561,7 @@ load_overlay_strings (it, charpos) | |||
| 3561 | xassert (OVERLAYP (overlay)); | 3561 | xassert (OVERLAYP (overlay)); |
| 3562 | start = OVERLAY_POSITION (OVERLAY_START (overlay)); | 3562 | start = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 3563 | end = OVERLAY_POSITION (OVERLAY_END (overlay)); | 3563 | end = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 3564 | 3564 | ||
| 3565 | if (end < charpos) | 3565 | if (end < charpos) |
| 3566 | break; | 3566 | break; |
| 3567 | 3567 | ||
| @@ -3569,7 +3569,7 @@ load_overlay_strings (it, charpos) | |||
| 3569 | position. */ | 3569 | position. */ |
| 3570 | if (end != charpos && start != charpos) | 3570 | if (end != charpos && start != charpos) |
| 3571 | continue; | 3571 | continue; |
| 3572 | 3572 | ||
| 3573 | /* Skip this overlay if it doesn't apply to IT->w. */ | 3573 | /* Skip this overlay if it doesn't apply to IT->w. */ |
| 3574 | window = Foverlay_get (overlay, Qwindow); | 3574 | window = Foverlay_get (overlay, Qwindow); |
| 3575 | if (WINDOWP (window) && XWINDOW (window) != it->w) | 3575 | if (WINDOWP (window) && XWINDOW (window) != it->w) |
| @@ -3586,14 +3586,14 @@ load_overlay_strings (it, charpos) | |||
| 3586 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) | 3586 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) |
| 3587 | && SCHARS (str)) | 3587 | && SCHARS (str)) |
| 3588 | RECORD_OVERLAY_STRING (overlay, str, 0); | 3588 | RECORD_OVERLAY_STRING (overlay, str, 0); |
| 3589 | 3589 | ||
| 3590 | /* If overlay has a non-empty after-string, record it. */ | 3590 | /* If overlay has a non-empty after-string, record it. */ |
| 3591 | if ((end == charpos || (start == charpos && invis_p)) | 3591 | if ((end == charpos || (start == charpos && invis_p)) |
| 3592 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) | 3592 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) |
| 3593 | && SCHARS (str)) | 3593 | && SCHARS (str)) |
| 3594 | RECORD_OVERLAY_STRING (overlay, str, 1); | 3594 | RECORD_OVERLAY_STRING (overlay, str, 1); |
| 3595 | } | 3595 | } |
| 3596 | 3596 | ||
| 3597 | /* Process overlays after the overlay center. */ | 3597 | /* Process overlays after the overlay center. */ |
| 3598 | for (ov = current_buffer->overlays_after; CONSP (ov); ov = XCDR (ov)) | 3598 | for (ov = current_buffer->overlays_after; CONSP (ov); ov = XCDR (ov)) |
| 3599 | { | 3599 | { |
| @@ -3604,7 +3604,7 @@ load_overlay_strings (it, charpos) | |||
| 3604 | 3604 | ||
| 3605 | if (start > charpos) | 3605 | if (start > charpos) |
| 3606 | break; | 3606 | break; |
| 3607 | 3607 | ||
| 3608 | /* Skip this overlay if it doesn't start or end at IT's current | 3608 | /* Skip this overlay if it doesn't start or end at IT's current |
| 3609 | position. */ | 3609 | position. */ |
| 3610 | if (end != charpos && start != charpos) | 3610 | if (end != charpos && start != charpos) |
| @@ -3614,7 +3614,7 @@ load_overlay_strings (it, charpos) | |||
| 3614 | window = Foverlay_get (overlay, Qwindow); | 3614 | window = Foverlay_get (overlay, Qwindow); |
| 3615 | if (WINDOWP (window) && XWINDOW (window) != it->w) | 3615 | if (WINDOWP (window) && XWINDOW (window) != it->w) |
| 3616 | continue; | 3616 | continue; |
| 3617 | 3617 | ||
| 3618 | /* If the text ``under'' the overlay is invisible, it has a zero | 3618 | /* If the text ``under'' the overlay is invisible, it has a zero |
| 3619 | dimension, and both before- and after-strings apply. */ | 3619 | dimension, and both before- and after-strings apply. */ |
| 3620 | invisible = Foverlay_get (overlay, Qinvisible); | 3620 | invisible = Foverlay_get (overlay, Qinvisible); |
| @@ -3625,7 +3625,7 @@ load_overlay_strings (it, charpos) | |||
| 3625 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) | 3625 | && (str = Foverlay_get (overlay, Qbefore_string), STRINGP (str)) |
| 3626 | && SCHARS (str)) | 3626 | && SCHARS (str)) |
| 3627 | RECORD_OVERLAY_STRING (overlay, str, 0); | 3627 | RECORD_OVERLAY_STRING (overlay, str, 0); |
| 3628 | 3628 | ||
| 3629 | /* If overlay has a non-empty after-string, record it. */ | 3629 | /* If overlay has a non-empty after-string, record it. */ |
| 3630 | if ((end == charpos || (start == charpos && invis_p)) | 3630 | if ((end == charpos || (start == charpos && invis_p)) |
| 3631 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) | 3631 | && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str)) |
| @@ -3634,7 +3634,7 @@ load_overlay_strings (it, charpos) | |||
| 3634 | } | 3634 | } |
| 3635 | 3635 | ||
| 3636 | #undef RECORD_OVERLAY_STRING | 3636 | #undef RECORD_OVERLAY_STRING |
| 3637 | 3637 | ||
| 3638 | /* Sort entries. */ | 3638 | /* Sort entries. */ |
| 3639 | if (n > 1) | 3639 | if (n > 1) |
| 3640 | qsort (entries, n, sizeof *entries, compare_overlay_entries); | 3640 | qsort (entries, n, sizeof *entries, compare_overlay_entries); |
| @@ -3683,7 +3683,7 @@ get_overlay_strings (it, charpos) | |||
| 3683 | strings. */ | 3683 | strings. */ |
| 3684 | compute_stop_pos (it); | 3684 | compute_stop_pos (it); |
| 3685 | xassert (it->face_id >= 0); | 3685 | xassert (it->face_id >= 0); |
| 3686 | 3686 | ||
| 3687 | /* Save IT's settings. They are restored after all overlay | 3687 | /* Save IT's settings. They are restored after all overlay |
| 3688 | strings have been processed. */ | 3688 | strings have been processed. */ |
| 3689 | xassert (it->sp == 0); | 3689 | xassert (it->sp == 0); |
| @@ -3728,7 +3728,7 @@ push_it (it) | |||
| 3728 | struct it *it; | 3728 | struct it *it; |
| 3729 | { | 3729 | { |
| 3730 | struct iterator_stack_entry *p; | 3730 | struct iterator_stack_entry *p; |
| 3731 | 3731 | ||
| 3732 | xassert (it->sp < 2); | 3732 | xassert (it->sp < 2); |
| 3733 | p = it->stack + it->sp; | 3733 | p = it->stack + it->sp; |
| 3734 | 3734 | ||
| @@ -3761,7 +3761,7 @@ pop_it (it) | |||
| 3761 | struct it *it; | 3761 | struct it *it; |
| 3762 | { | 3762 | { |
| 3763 | struct iterator_stack_entry *p; | 3763 | struct iterator_stack_entry *p; |
| 3764 | 3764 | ||
| 3765 | xassert (it->sp > 0); | 3765 | xassert (it->sp > 0); |
| 3766 | --it->sp; | 3766 | --it->sp; |
| 3767 | p = it->stack + it->sp; | 3767 | p = it->stack + it->sp; |
| @@ -3797,12 +3797,12 @@ back_to_previous_line_start (it) | |||
| 3797 | 3797 | ||
| 3798 | 3798 | ||
| 3799 | /* Move IT to the next line start. | 3799 | /* Move IT to the next line start. |
| 3800 | 3800 | ||
| 3801 | Value is non-zero if a newline was found. Set *SKIPPED_P to 1 if | 3801 | Value is non-zero if a newline was found. Set *SKIPPED_P to 1 if |
| 3802 | we skipped over part of the text (as opposed to moving the iterator | 3802 | we skipped over part of the text (as opposed to moving the iterator |
| 3803 | continuously over the text). Otherwise, don't change the value | 3803 | continuously over the text). Otherwise, don't change the value |
| 3804 | of *SKIPPED_P. | 3804 | of *SKIPPED_P. |
| 3805 | 3805 | ||
| 3806 | Newlines may come from buffer text, overlay strings, or strings | 3806 | Newlines may come from buffer text, overlay strings, or strings |
| 3807 | displayed via the `display' property. That's the reason we can't | 3807 | displayed via the `display' property. That's the reason we can't |
| 3808 | simply use find_next_newline_no_quit. | 3808 | simply use find_next_newline_no_quit. |
| @@ -3918,9 +3918,9 @@ back_to_previous_visible_line_start (it) | |||
| 3918 | are invisible. */ | 3918 | are invisible. */ |
| 3919 | if (it->selective > 0 | 3919 | if (it->selective > 0 |
| 3920 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), | 3920 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), |
| 3921 | it->selective)) | 3921 | (float) it->selective)) /* iftc */ |
| 3922 | visible_p = 0; | 3922 | visible_p = 0; |
| 3923 | else | 3923 | else |
| 3924 | { | 3924 | { |
| 3925 | Lisp_Object prop; | 3925 | Lisp_Object prop; |
| 3926 | 3926 | ||
| @@ -3978,7 +3978,7 @@ reseat_at_next_visible_line_start (it, on_newline_p) | |||
| 3978 | if (it->selective > 0) | 3978 | if (it->selective > 0) |
| 3979 | while (IT_CHARPOS (*it) < ZV | 3979 | while (IT_CHARPOS (*it) < ZV |
| 3980 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), | 3980 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), |
| 3981 | it->selective)) | 3981 | (float) it->selective)) /* iftc */ |
| 3982 | { | 3982 | { |
| 3983 | xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); | 3983 | xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); |
| 3984 | newline_found_p = forward_to_next_line_start (it, &skipped_p); | 3984 | newline_found_p = forward_to_next_line_start (it, &skipped_p); |
| @@ -4004,7 +4004,7 @@ reseat_at_next_visible_line_start (it, on_newline_p) | |||
| 4004 | } | 4004 | } |
| 4005 | else if (skipped_p) | 4005 | else if (skipped_p) |
| 4006 | reseat (it, it->current.pos, 0); | 4006 | reseat (it, it->current.pos, 0); |
| 4007 | 4007 | ||
| 4008 | CHECK_IT (it); | 4008 | CHECK_IT (it); |
| 4009 | } | 4009 | } |
| 4010 | 4010 | ||
| @@ -4077,7 +4077,7 @@ reseat_1 (it, pos, set_stop_p) | |||
| 4077 | /* Set up IT for displaying a string, starting at CHARPOS in window W. | 4077 | /* Set up IT for displaying a string, starting at CHARPOS in window W. |
| 4078 | If S is non-null, it is a C string to iterate over. Otherwise, | 4078 | If S is non-null, it is a C string to iterate over. Otherwise, |
| 4079 | STRING gives a Lisp string to iterate over. | 4079 | STRING gives a Lisp string to iterate over. |
| 4080 | 4080 | ||
| 4081 | If PRECISION > 0, don't return more then PRECISION number of | 4081 | If PRECISION > 0, don't return more then PRECISION number of |
| 4082 | characters from the string. | 4082 | characters from the string. |
| 4083 | 4083 | ||
| @@ -4111,12 +4111,12 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte) | |||
| 4111 | it->current.overlay_string_index = -1; | 4111 | it->current.overlay_string_index = -1; |
| 4112 | it->current.dpvec_index = -1; | 4112 | it->current.dpvec_index = -1; |
| 4113 | xassert (charpos >= 0); | 4113 | xassert (charpos >= 0); |
| 4114 | 4114 | ||
| 4115 | /* If STRING is specified, use its multibyteness, otherwise use the | 4115 | /* If STRING is specified, use its multibyteness, otherwise use the |
| 4116 | setting of MULTIBYTE, if specified. */ | 4116 | setting of MULTIBYTE, if specified. */ |
| 4117 | if (multibyte >= 0) | 4117 | if (multibyte >= 0) |
| 4118 | it->multibyte_p = multibyte > 0; | 4118 | it->multibyte_p = multibyte > 0; |
| 4119 | 4119 | ||
| 4120 | if (s == NULL) | 4120 | if (s == NULL) |
| 4121 | { | 4121 | { |
| 4122 | xassert (STRINGP (string)); | 4122 | xassert (STRINGP (string)); |
| @@ -4144,7 +4144,7 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte) | |||
| 4144 | IT_CHARPOS (*it) = IT_BYTEPOS (*it) = charpos; | 4144 | IT_CHARPOS (*it) = IT_BYTEPOS (*it) = charpos; |
| 4145 | it->end_charpos = it->string_nchars = strlen (s); | 4145 | it->end_charpos = it->string_nchars = strlen (s); |
| 4146 | } | 4146 | } |
| 4147 | 4147 | ||
| 4148 | it->method = next_element_from_c_string; | 4148 | it->method = next_element_from_c_string; |
| 4149 | } | 4149 | } |
| 4150 | 4150 | ||
| @@ -4314,11 +4314,11 @@ get_next_display_element (it) | |||
| 4314 | XSETINT (it->ctl_chars[i * 4], escape_glyph); | 4314 | XSETINT (it->ctl_chars[i * 4], escape_glyph); |
| 4315 | /* Insert three more glyphs into IT->ctl_chars for | 4315 | /* Insert three more glyphs into IT->ctl_chars for |
| 4316 | the octal display of the character. */ | 4316 | the octal display of the character. */ |
| 4317 | g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 0); | 4317 | g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 0); |
| 4318 | XSETINT (it->ctl_chars[i * 4 + 1], g); | 4318 | XSETINT (it->ctl_chars[i * 4 + 1], g); |
| 4319 | g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 0); | 4319 | g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 0); |
| 4320 | XSETINT (it->ctl_chars[i * 4 + 2], g); | 4320 | XSETINT (it->ctl_chars[i * 4 + 2], g); |
| 4321 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0); | 4321 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0); |
| 4322 | XSETINT (it->ctl_chars[i * 4 + 3], g); | 4322 | XSETINT (it->ctl_chars[i * 4 + 3], g); |
| 4323 | } | 4323 | } |
| 4324 | 4324 | ||
| @@ -4389,7 +4389,7 @@ set_iterator_to_next (it, reseat_p) | |||
| 4389 | with box. Reset them at the start of this function because | 4389 | with box. Reset them at the start of this function because |
| 4390 | moving the iterator to a new position might set them. */ | 4390 | moving the iterator to a new position might set them. */ |
| 4391 | it->start_of_box_run_p = it->end_of_box_run_p = 0; | 4391 | it->start_of_box_run_p = it->end_of_box_run_p = 0; |
| 4392 | 4392 | ||
| 4393 | if (it->method == next_element_from_buffer) | 4393 | if (it->method == next_element_from_buffer) |
| 4394 | { | 4394 | { |
| 4395 | /* The current display element of IT is a character from | 4395 | /* The current display element of IT is a character from |
| @@ -4439,7 +4439,7 @@ set_iterator_to_next (it, reseat_p) | |||
| 4439 | /* Restore face of the iterator to what they were before the | 4439 | /* Restore face of the iterator to what they were before the |
| 4440 | display vector entry (these entries may contain faces). */ | 4440 | display vector entry (these entries may contain faces). */ |
| 4441 | it->face_id = it->saved_face_id; | 4441 | it->face_id = it->saved_face_id; |
| 4442 | 4442 | ||
| 4443 | if (it->dpvec + it->current.dpvec_index == it->dpend) | 4443 | if (it->dpvec + it->current.dpvec_index == it->dpend) |
| 4444 | { | 4444 | { |
| 4445 | if (it->s) | 4445 | if (it->s) |
| @@ -4468,7 +4468,7 @@ set_iterator_to_next (it, reseat_p) | |||
| 4468 | xassert (it->s == NULL && STRINGP (it->string)); | 4468 | xassert (it->s == NULL && STRINGP (it->string)); |
| 4469 | IT_STRING_BYTEPOS (*it) += it->len; | 4469 | IT_STRING_BYTEPOS (*it) += it->len; |
| 4470 | IT_STRING_CHARPOS (*it) += 1; | 4470 | IT_STRING_CHARPOS (*it) += 1; |
| 4471 | 4471 | ||
| 4472 | consider_string_end: | 4472 | consider_string_end: |
| 4473 | 4473 | ||
| 4474 | if (it->current.overlay_string_index >= 0) | 4474 | if (it->current.overlay_string_index >= 0) |
| @@ -4536,7 +4536,7 @@ next_element_from_display_vector (it) | |||
| 4536 | /* Remember the current face id in case glyphs specify faces. | 4536 | /* Remember the current face id in case glyphs specify faces. |
| 4537 | IT's face is restored in set_iterator_to_next. */ | 4537 | IT's face is restored in set_iterator_to_next. */ |
| 4538 | it->saved_face_id = it->face_id; | 4538 | it->saved_face_id = it->face_id; |
| 4539 | 4539 | ||
| 4540 | if (INTEGERP (*it->dpvec) | 4540 | if (INTEGERP (*it->dpvec) |
| 4541 | && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) | 4541 | && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) |
| 4542 | { | 4542 | { |
| @@ -4671,12 +4671,12 @@ next_element_from_c_string (it) | |||
| 4671 | struct it *it; | 4671 | struct it *it; |
| 4672 | { | 4672 | { |
| 4673 | int success_p = 1; | 4673 | int success_p = 1; |
| 4674 | 4674 | ||
| 4675 | xassert (it->s); | 4675 | xassert (it->s); |
| 4676 | it->what = IT_CHARACTER; | 4676 | it->what = IT_CHARACTER; |
| 4677 | BYTEPOS (it->position) = CHARPOS (it->position) = 0; | 4677 | BYTEPOS (it->position) = CHARPOS (it->position) = 0; |
| 4678 | it->object = Qnil; | 4678 | it->object = Qnil; |
| 4679 | 4679 | ||
| 4680 | /* IT's position can be greater IT->string_nchars in case a field | 4680 | /* IT's position can be greater IT->string_nchars in case a field |
| 4681 | width or precision has been specified when the iterator was | 4681 | width or precision has been specified when the iterator was |
| 4682 | initialized. */ | 4682 | initialized. */ |
| @@ -4703,7 +4703,7 @@ next_element_from_c_string (it) | |||
| 4703 | } | 4703 | } |
| 4704 | else | 4704 | else |
| 4705 | it->c = it->s[IT_BYTEPOS (*it)], it->len = 1; | 4705 | it->c = it->s[IT_BYTEPOS (*it)], it->len = 1; |
| 4706 | 4706 | ||
| 4707 | return success_p; | 4707 | return success_p; |
| 4708 | } | 4708 | } |
| 4709 | 4709 | ||
| @@ -4751,7 +4751,7 @@ next_element_from_ellipsis (it) | |||
| 4751 | reseat_at_next_visible_line_start (it, 1); | 4751 | reseat_at_next_visible_line_start (it, 1); |
| 4752 | it->face_before_selective_p = 1; | 4752 | it->face_before_selective_p = 1; |
| 4753 | } | 4753 | } |
| 4754 | 4754 | ||
| 4755 | return get_next_display_element (it); | 4755 | return get_next_display_element (it); |
| 4756 | } | 4756 | } |
| 4757 | 4757 | ||
| @@ -4759,7 +4759,7 @@ next_element_from_ellipsis (it) | |||
| 4759 | /* Deliver an image display element. The iterator IT is already | 4759 | /* Deliver an image display element. The iterator IT is already |
| 4760 | filled with image information (done in handle_display_prop). Value | 4760 | filled with image information (done in handle_display_prop). Value |
| 4761 | is always 1. */ | 4761 | is always 1. */ |
| 4762 | 4762 | ||
| 4763 | 4763 | ||
| 4764 | static int | 4764 | static int |
| 4765 | next_element_from_image (it) | 4765 | next_element_from_image (it) |
| @@ -4804,7 +4804,7 @@ next_element_from_buffer (it) | |||
| 4804 | if (IT_CHARPOS (*it) >= it->end_charpos) | 4804 | if (IT_CHARPOS (*it) >= it->end_charpos) |
| 4805 | { | 4805 | { |
| 4806 | int overlay_strings_follow_p; | 4806 | int overlay_strings_follow_p; |
| 4807 | 4807 | ||
| 4808 | /* End of the game, except when overlay strings follow that | 4808 | /* End of the game, except when overlay strings follow that |
| 4809 | haven't been returned yet. */ | 4809 | haven't been returned yet. */ |
| 4810 | if (it->overlay_strings_at_end_processed_p) | 4810 | if (it->overlay_strings_at_end_processed_p) |
| @@ -4871,7 +4871,7 @@ next_element_from_buffer (it) | |||
| 4871 | && IT_CHARPOS (*it) + 1 < ZV | 4871 | && IT_CHARPOS (*it) + 1 < ZV |
| 4872 | && indented_beyond_p (IT_CHARPOS (*it) + 1, | 4872 | && indented_beyond_p (IT_CHARPOS (*it) + 1, |
| 4873 | IT_BYTEPOS (*it) + 1, | 4873 | IT_BYTEPOS (*it) + 1, |
| 4874 | it->selective)) | 4874 | (float) it->selective)) /* iftc */ |
| 4875 | { | 4875 | { |
| 4876 | success_p = next_element_from_ellipsis (it); | 4876 | success_p = next_element_from_ellipsis (it); |
| 4877 | it->dpvec_char_len = -1; | 4877 | it->dpvec_char_len = -1; |
| @@ -4893,7 +4893,7 @@ next_element_from_buffer (it) | |||
| 4893 | return success_p; | 4893 | return success_p; |
| 4894 | } | 4894 | } |
| 4895 | 4895 | ||
| 4896 | 4896 | ||
| 4897 | /* Run the redisplay end trigger hook for IT. */ | 4897 | /* Run the redisplay end trigger hook for IT. */ |
| 4898 | 4898 | ||
| 4899 | static void | 4899 | static void |
| @@ -4916,7 +4916,7 @@ run_redisplay_end_trigger_hook (it) | |||
| 4916 | them again, even if they get an error. */ | 4916 | them again, even if they get an error. */ |
| 4917 | it->w->redisplay_end_trigger = Qnil; | 4917 | it->w->redisplay_end_trigger = Qnil; |
| 4918 | Frun_hook_with_args (3, args); | 4918 | Frun_hook_with_args (3, args); |
| 4919 | 4919 | ||
| 4920 | /* Notice if it changed the face of the character we are on. */ | 4920 | /* Notice if it changed the face of the character we are on. */ |
| 4921 | handle_face_prop (it); | 4921 | handle_face_prop (it); |
| 4922 | } | 4922 | } |
| @@ -4960,14 +4960,14 @@ next_element_from_composition (it) | |||
| 4960 | 4960 | ||
| 4961 | MOVE_POS_MATCH_OR_ZV | 4961 | MOVE_POS_MATCH_OR_ZV |
| 4962 | - when TO_POS or ZV was reached. | 4962 | - when TO_POS or ZV was reached. |
| 4963 | 4963 | ||
| 4964 | MOVE_X_REACHED | 4964 | MOVE_X_REACHED |
| 4965 | -when TO_X was reached before TO_POS or ZV were reached. | 4965 | -when TO_X was reached before TO_POS or ZV were reached. |
| 4966 | 4966 | ||
| 4967 | MOVE_LINE_CONTINUED | 4967 | MOVE_LINE_CONTINUED |
| 4968 | - when we reached the end of the display area and the line must | 4968 | - when we reached the end of the display area and the line must |
| 4969 | be continued. | 4969 | be continued. |
| 4970 | 4970 | ||
| 4971 | MOVE_LINE_TRUNCATED | 4971 | MOVE_LINE_TRUNCATED |
| 4972 | - when we reached the end of the display area and the line is | 4972 | - when we reached the end of the display area and the line is |
| 4973 | truncated. | 4973 | truncated. |
| @@ -4991,7 +4991,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 4991 | while (1) | 4991 | while (1) |
| 4992 | { | 4992 | { |
| 4993 | int x, i, ascent = 0, descent = 0; | 4993 | int x, i, ascent = 0, descent = 0; |
| 4994 | 4994 | ||
| 4995 | /* Stop when ZV or TO_CHARPOS reached. */ | 4995 | /* Stop when ZV or TO_CHARPOS reached. */ |
| 4996 | if (!get_next_display_element (it) | 4996 | if (!get_next_display_element (it) |
| 4997 | || ((op & MOVE_TO_POS) != 0 | 4997 | || ((op & MOVE_TO_POS) != 0 |
| @@ -5001,13 +5001,13 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5001 | result = MOVE_POS_MATCH_OR_ZV; | 5001 | result = MOVE_POS_MATCH_OR_ZV; |
| 5002 | break; | 5002 | break; |
| 5003 | } | 5003 | } |
| 5004 | 5004 | ||
| 5005 | /* The call to produce_glyphs will get the metrics of the | 5005 | /* The call to produce_glyphs will get the metrics of the |
| 5006 | display element IT is loaded with. We record in x the | 5006 | display element IT is loaded with. We record in x the |
| 5007 | x-position before this display element in case it does not | 5007 | x-position before this display element in case it does not |
| 5008 | fit on the line. */ | 5008 | fit on the line. */ |
| 5009 | x = it->current_x; | 5009 | x = it->current_x; |
| 5010 | 5010 | ||
| 5011 | /* Remember the line height so far in case the next element doesn't | 5011 | /* Remember the line height so far in case the next element doesn't |
| 5012 | fit on the line. */ | 5012 | fit on the line. */ |
| 5013 | if (!it->truncate_lines_p) | 5013 | if (!it->truncate_lines_p) |
| @@ -5015,7 +5015,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5015 | ascent = it->max_ascent; | 5015 | ascent = it->max_ascent; |
| 5016 | descent = it->max_descent; | 5016 | descent = it->max_descent; |
| 5017 | } | 5017 | } |
| 5018 | 5018 | ||
| 5019 | PRODUCE_GLYPHS (it); | 5019 | PRODUCE_GLYPHS (it); |
| 5020 | 5020 | ||
| 5021 | if (it->area != TEXT_AREA) | 5021 | if (it->area != TEXT_AREA) |
| @@ -5048,7 +5048,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5048 | glyphs have the same width. */ | 5048 | glyphs have the same width. */ |
| 5049 | int single_glyph_width = it->pixel_width / it->nglyphs; | 5049 | int single_glyph_width = it->pixel_width / it->nglyphs; |
| 5050 | int new_x; | 5050 | int new_x; |
| 5051 | 5051 | ||
| 5052 | for (i = 0; i < it->nglyphs; ++i, x = new_x) | 5052 | for (i = 0; i < it->nglyphs; ++i, x = new_x) |
| 5053 | { | 5053 | { |
| 5054 | new_x = x + single_glyph_width; | 5054 | new_x = x + single_glyph_width; |
| @@ -5086,7 +5086,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5086 | it->max_ascent = ascent; | 5086 | it->max_ascent = ascent; |
| 5087 | it->max_descent = descent; | 5087 | it->max_descent = descent; |
| 5088 | } | 5088 | } |
| 5089 | 5089 | ||
| 5090 | TRACE_MOVE ((stderr, "move_it_in: continued at %d\n", | 5090 | TRACE_MOVE ((stderr, "move_it_in: continued at %d\n", |
| 5091 | IT_CHARPOS (*it))); | 5091 | IT_CHARPOS (*it))); |
| 5092 | result = MOVE_LINE_CONTINUED; | 5092 | result = MOVE_LINE_CONTINUED; |
| @@ -5100,7 +5100,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5100 | } | 5100 | } |
| 5101 | else | 5101 | else |
| 5102 | { | 5102 | { |
| 5103 | /* Glyph is completely off the left margin of the display | 5103 | /* Glyph is completely off the left margin of the display |
| 5104 | area. Nothing to do. */ | 5104 | area. Nothing to do. */ |
| 5105 | } | 5105 | } |
| 5106 | } | 5106 | } |
| @@ -5118,18 +5118,18 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5118 | result = MOVE_X_REACHED; | 5118 | result = MOVE_X_REACHED; |
| 5119 | break; | 5119 | break; |
| 5120 | } | 5120 | } |
| 5121 | 5121 | ||
| 5122 | /* Is this a line end? If yes, we're done. */ | 5122 | /* Is this a line end? If yes, we're done. */ |
| 5123 | if (ITERATOR_AT_END_OF_LINE_P (it)) | 5123 | if (ITERATOR_AT_END_OF_LINE_P (it)) |
| 5124 | { | 5124 | { |
| 5125 | result = MOVE_NEWLINE_OR_CR; | 5125 | result = MOVE_NEWLINE_OR_CR; |
| 5126 | break; | 5126 | break; |
| 5127 | } | 5127 | } |
| 5128 | 5128 | ||
| 5129 | /* The current display element has been consumed. Advance | 5129 | /* The current display element has been consumed. Advance |
| 5130 | to the next. */ | 5130 | to the next. */ |
| 5131 | set_iterator_to_next (it, 1); | 5131 | set_iterator_to_next (it, 1); |
| 5132 | 5132 | ||
| 5133 | /* Stop if lines are truncated and IT's current x-position is | 5133 | /* Stop if lines are truncated and IT's current x-position is |
| 5134 | past the right edge of the window now. */ | 5134 | past the right edge of the window now. */ |
| 5135 | if (it->truncate_lines_p | 5135 | if (it->truncate_lines_p |
| @@ -5153,7 +5153,7 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5153 | OP is a bit-mask that specifies where to stop, and in particular, | 5153 | OP is a bit-mask that specifies where to stop, and in particular, |
| 5154 | which of those four position arguments makes a difference. See the | 5154 | which of those four position arguments makes a difference. See the |
| 5155 | description of enum move_operation_enum. | 5155 | description of enum move_operation_enum. |
| 5156 | 5156 | ||
| 5157 | If TO_CHARPOS is in invisible text, e.g. a truncated part of a | 5157 | If TO_CHARPOS is in invisible text, e.g. a truncated part of a |
| 5158 | screen line, this function will set IT to the next position > | 5158 | screen line, this function will set IT to the next position > |
| 5159 | TO_CHARPOS. */ | 5159 | TO_CHARPOS. */ |
| @@ -5193,7 +5193,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 5193 | reached = 2; | 5193 | reached = 2; |
| 5194 | break; | 5194 | break; |
| 5195 | } | 5195 | } |
| 5196 | 5196 | ||
| 5197 | skip = move_it_in_display_line_to (it, to_charpos, to_x, op); | 5197 | skip = move_it_in_display_line_to (it, to_charpos, to_x, op); |
| 5198 | 5198 | ||
| 5199 | if (skip == MOVE_POS_MATCH_OR_ZV || it->vpos == to_vpos) | 5199 | if (skip == MOVE_POS_MATCH_OR_ZV || it->vpos == to_vpos) |
| @@ -5217,7 +5217,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 5217 | else if (op & MOVE_TO_Y) | 5217 | else if (op & MOVE_TO_Y) |
| 5218 | { | 5218 | { |
| 5219 | struct it it_backup; | 5219 | struct it it_backup; |
| 5220 | 5220 | ||
| 5221 | /* TO_Y specified means stop at TO_X in the line containing | 5221 | /* TO_Y specified means stop at TO_X in the line containing |
| 5222 | TO_Y---or at TO_CHARPOS if this is reached first. The | 5222 | TO_Y---or at TO_CHARPOS if this is reached first. The |
| 5223 | problem is that we can't really tell whether the line | 5223 | problem is that we can't really tell whether the line |
| @@ -5242,7 +5242,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 5242 | reached = 5; | 5242 | reached = 5; |
| 5243 | break; | 5243 | break; |
| 5244 | } | 5244 | } |
| 5245 | 5245 | ||
| 5246 | /* If TO_X was reached, we would like to know whether TO_Y | 5246 | /* If TO_X was reached, we would like to know whether TO_Y |
| 5247 | is in the line. This can only be said if we know the | 5247 | is in the line. This can only be said if we know the |
| 5248 | total line height which requires us to scan the rest of | 5248 | total line height which requires us to scan the rest of |
| @@ -5259,7 +5259,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 5259 | /* Now, decide whether TO_Y is in this line. */ | 5259 | /* Now, decide whether TO_Y is in this line. */ |
| 5260 | line_height = it->max_ascent + it->max_descent; | 5260 | line_height = it->max_ascent + it->max_descent; |
| 5261 | TRACE_MOVE ((stderr, "move_it: line_height = %d\n", line_height)); | 5261 | TRACE_MOVE ((stderr, "move_it: line_height = %d\n", line_height)); |
| 5262 | 5262 | ||
| 5263 | if (to_y >= it->current_y | 5263 | if (to_y >= it->current_y |
| 5264 | && to_y < it->current_y + line_height) | 5264 | && to_y < it->current_y + line_height) |
| 5265 | { | 5265 | { |
| @@ -5322,7 +5322,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op) | |||
| 5322 | last_max_ascent = it->max_ascent; | 5322 | last_max_ascent = it->max_ascent; |
| 5323 | it->max_ascent = it->max_descent = 0; | 5323 | it->max_ascent = it->max_descent = 0; |
| 5324 | } | 5324 | } |
| 5325 | 5325 | ||
| 5326 | out: | 5326 | out: |
| 5327 | 5327 | ||
| 5328 | TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached)); | 5328 | TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached)); |
| @@ -5345,7 +5345,7 @@ move_it_vertically_backward (it, dy) | |||
| 5345 | int nlines, h; | 5345 | int nlines, h; |
| 5346 | struct it it2, it3; | 5346 | struct it it2, it3; |
| 5347 | int start_pos = IT_CHARPOS (*it); | 5347 | int start_pos = IT_CHARPOS (*it); |
| 5348 | 5348 | ||
| 5349 | xassert (dy >= 0); | 5349 | xassert (dy >= 0); |
| 5350 | 5350 | ||
| 5351 | /* Estimate how many newlines we must move back. */ | 5351 | /* Estimate how many newlines we must move back. */ |
| @@ -5374,7 +5374,7 @@ move_it_vertically_backward (it, dy) | |||
| 5374 | MOVE_TO_POS | MOVE_TO_VPOS); | 5374 | MOVE_TO_POS | MOVE_TO_VPOS); |
| 5375 | xassert (IT_CHARPOS (*it) >= BEGV); | 5375 | xassert (IT_CHARPOS (*it) >= BEGV); |
| 5376 | it3 = it2; | 5376 | it3 = it2; |
| 5377 | 5377 | ||
| 5378 | move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); | 5378 | move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); |
| 5379 | xassert (IT_CHARPOS (*it) >= BEGV); | 5379 | xassert (IT_CHARPOS (*it) >= BEGV); |
| 5380 | h = it2.current_y - it->current_y; | 5380 | h = it2.current_y - it->current_y; |
| @@ -5383,7 +5383,7 @@ move_it_vertically_backward (it, dy) | |||
| 5383 | /* Correct IT's y and vpos position. */ | 5383 | /* Correct IT's y and vpos position. */ |
| 5384 | it->vpos -= nlines; | 5384 | it->vpos -= nlines; |
| 5385 | it->current_y -= h; | 5385 | it->current_y -= h; |
| 5386 | 5386 | ||
| 5387 | if (dy == 0) | 5387 | if (dy == 0) |
| 5388 | { | 5388 | { |
| 5389 | /* DY == 0 means move to the start of the screen line. The | 5389 | /* DY == 0 means move to the start of the screen line. The |
| @@ -5420,13 +5420,13 @@ move_it_vertically_backward (it, dy) | |||
| 5420 | && IT_CHARPOS (*it) < ZV) | 5420 | && IT_CHARPOS (*it) < ZV) |
| 5421 | { | 5421 | { |
| 5422 | /* Should move forward by at least one line, maybe more. | 5422 | /* Should move forward by at least one line, maybe more. |
| 5423 | 5423 | ||
| 5424 | Note: Calling move_it_by_lines can be expensive on | 5424 | Note: Calling move_it_by_lines can be expensive on |
| 5425 | terminal frames, where compute_motion is used (via | 5425 | terminal frames, where compute_motion is used (via |
| 5426 | vmotion) to do the job, when there are very long lines | 5426 | vmotion) to do the job, when there are very long lines |
| 5427 | and truncate-lines is nil. That's the reason for | 5427 | and truncate-lines is nil. That's the reason for |
| 5428 | treating terminal frames specially here. */ | 5428 | treating terminal frames specially here. */ |
| 5429 | 5429 | ||
| 5430 | if (!FRAME_WINDOW_P (it->f)) | 5430 | if (!FRAME_WINDOW_P (it->f)) |
| 5431 | move_it_vertically (it, target_y - (it->current_y + line_height)); | 5431 | move_it_vertically (it, target_y - (it->current_y + line_height)); |
| 5432 | else | 5432 | else |
| @@ -5448,7 +5448,7 @@ move_it_vertically_backward (it, dy) | |||
| 5448 | move backwards. DY = 0 means move to start of screen line. At the | 5448 | move backwards. DY = 0 means move to start of screen line. At the |
| 5449 | end, IT will be on the start of a screen line. */ | 5449 | end, IT will be on the start of a screen line. */ |
| 5450 | 5450 | ||
| 5451 | void | 5451 | void |
| 5452 | move_it_vertically (it, dy) | 5452 | move_it_vertically (it, dy) |
| 5453 | struct it *it; | 5453 | struct it *it; |
| 5454 | int dy; | 5454 | int dy; |
| @@ -5478,7 +5478,7 @@ move_it_past_eol (it) | |||
| 5478 | struct it *it; | 5478 | struct it *it; |
| 5479 | { | 5479 | { |
| 5480 | enum move_it_result rc; | 5480 | enum move_it_result rc; |
| 5481 | 5481 | ||
| 5482 | rc = move_it_in_display_line_to (it, Z, 0, MOVE_TO_POS); | 5482 | rc = move_it_in_display_line_to (it, Z, 0, MOVE_TO_POS); |
| 5483 | if (rc == MOVE_NEWLINE_OR_CR) | 5483 | if (rc == MOVE_NEWLINE_OR_CR) |
| 5484 | set_iterator_to_next (it, 0); | 5484 | set_iterator_to_next (it, 0); |
| @@ -5498,7 +5498,7 @@ invisible_text_between_p (it, start_charpos, end_charpos) | |||
| 5498 | { | 5498 | { |
| 5499 | Lisp_Object prop, limit; | 5499 | Lisp_Object prop, limit; |
| 5500 | int invisible_found_p; | 5500 | int invisible_found_p; |
| 5501 | 5501 | ||
| 5502 | xassert (it != NULL && start_charpos <= end_charpos); | 5502 | xassert (it != NULL && start_charpos <= end_charpos); |
| 5503 | 5503 | ||
| 5504 | /* Is text at START invisible? */ | 5504 | /* Is text at START invisible? */ |
| @@ -5535,11 +5535,11 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 5535 | int dvpos, need_y_p; | 5535 | int dvpos, need_y_p; |
| 5536 | { | 5536 | { |
| 5537 | struct position pos; | 5537 | struct position pos; |
| 5538 | 5538 | ||
| 5539 | if (!FRAME_WINDOW_P (it->f)) | 5539 | if (!FRAME_WINDOW_P (it->f)) |
| 5540 | { | 5540 | { |
| 5541 | struct text_pos textpos; | 5541 | struct text_pos textpos; |
| 5542 | 5542 | ||
| 5543 | /* We can use vmotion on frames without proportional fonts. */ | 5543 | /* We can use vmotion on frames without proportional fonts. */ |
| 5544 | pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w); | 5544 | pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w); |
| 5545 | SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos); | 5545 | SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos); |
| @@ -5559,11 +5559,11 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 5559 | { | 5559 | { |
| 5560 | struct it it2; | 5560 | struct it it2; |
| 5561 | int start_charpos, i; | 5561 | int start_charpos, i; |
| 5562 | 5562 | ||
| 5563 | /* Start at the beginning of the screen line containing IT's | 5563 | /* Start at the beginning of the screen line containing IT's |
| 5564 | position. */ | 5564 | position. */ |
| 5565 | move_it_vertically_backward (it, 0); | 5565 | move_it_vertically_backward (it, 0); |
| 5566 | 5566 | ||
| 5567 | /* Go back -DVPOS visible lines and reseat the iterator there. */ | 5567 | /* Go back -DVPOS visible lines and reseat the iterator there. */ |
| 5568 | start_charpos = IT_CHARPOS (*it); | 5568 | start_charpos = IT_CHARPOS (*it); |
| 5569 | for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) | 5569 | for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) |
| @@ -5618,7 +5618,7 @@ add_to_log (format, arg1, arg2) | |||
| 5618 | 5618 | ||
| 5619 | fmt = msg = Qnil; | 5619 | fmt = msg = Qnil; |
| 5620 | GCPRO4 (fmt, msg, arg1, arg2); | 5620 | GCPRO4 (fmt, msg, arg1, arg2); |
| 5621 | 5621 | ||
| 5622 | args[0] = fmt = build_string (format); | 5622 | args[0] = fmt = build_string (format); |
| 5623 | args[1] = arg1; | 5623 | args[1] = arg1; |
| 5624 | args[2] = arg2; | 5624 | args[2] = arg2; |
| @@ -5627,7 +5627,7 @@ add_to_log (format, arg1, arg2) | |||
| 5627 | len = SBYTES (msg) + 1; | 5627 | len = SBYTES (msg) + 1; |
| 5628 | buffer = (char *) alloca (len); | 5628 | buffer = (char *) alloca (len); |
| 5629 | bcopy (SDATA (msg), buffer, len); | 5629 | bcopy (SDATA (msg), buffer, len); |
| 5630 | 5630 | ||
| 5631 | message_dolog (buffer, len - 1, 1, 0); | 5631 | message_dolog (buffer, len - 1, 1, 0); |
| 5632 | UNGCPRO; | 5632 | UNGCPRO; |
| 5633 | } | 5633 | } |
| @@ -5695,7 +5695,7 @@ message_dolog (m, nbytes, nlflag, multibyte) | |||
| 5695 | { | 5695 | { |
| 5696 | int i, c, char_bytes; | 5696 | int i, c, char_bytes; |
| 5697 | unsigned char work[1]; | 5697 | unsigned char work[1]; |
| 5698 | 5698 | ||
| 5699 | /* Convert a multibyte string to single-byte | 5699 | /* Convert a multibyte string to single-byte |
| 5700 | for the *Message* buffer. */ | 5700 | for the *Message* buffer. */ |
| 5701 | for (i = 0; i < nbytes; i += nbytes) | 5701 | for (i = 0; i < nbytes; i += nbytes) |
| @@ -5898,7 +5898,7 @@ message2_nolog (m, nbytes, multibyte) | |||
| 5898 | /* A null message buffer means that the frame hasn't really been | 5898 | /* A null message buffer means that the frame hasn't really been |
| 5899 | initialized yet. Error messages get reported properly by | 5899 | initialized yet. Error messages get reported properly by |
| 5900 | cmd_error, so this must be just an informative message; toss it. */ | 5900 | cmd_error, so this must be just an informative message; toss it. */ |
| 5901 | else if (INTERACTIVE | 5901 | else if (INTERACTIVE |
| 5902 | && sf->glyphs_initialized_p | 5902 | && sf->glyphs_initialized_p |
| 5903 | && FRAME_MESSAGE_BUF (sf)) | 5903 | && FRAME_MESSAGE_BUF (sf)) |
| 5904 | { | 5904 | { |
| @@ -5947,7 +5947,7 @@ message3 (m, nbytes, multibyte) | |||
| 5947 | struct gcpro gcpro1; | 5947 | struct gcpro gcpro1; |
| 5948 | 5948 | ||
| 5949 | GCPRO1 (m); | 5949 | GCPRO1 (m); |
| 5950 | 5950 | ||
| 5951 | /* First flush out any partial line written with print. */ | 5951 | /* First flush out any partial line written with print. */ |
| 5952 | message_log_maybe_newline (); | 5952 | message_log_maybe_newline (); |
| 5953 | if (STRINGP (m)) | 5953 | if (STRINGP (m)) |
| @@ -5982,7 +5982,7 @@ message3_nolog (m, nbytes, multibyte) | |||
| 5982 | /* A null message buffer means that the frame hasn't really been | 5982 | /* A null message buffer means that the frame hasn't really been |
| 5983 | initialized yet. Error messages get reported properly by | 5983 | initialized yet. Error messages get reported properly by |
| 5984 | cmd_error, so this must be just an informative message; toss it. */ | 5984 | cmd_error, so this must be just an informative message; toss it. */ |
| 5985 | else if (INTERACTIVE | 5985 | else if (INTERACTIVE |
| 5986 | && sf->glyphs_initialized_p | 5986 | && sf->glyphs_initialized_p |
| 5987 | && FRAME_MESSAGE_BUF (sf)) | 5987 | && FRAME_MESSAGE_BUF (sf)) |
| 5988 | { | 5988 | { |
| @@ -6091,7 +6091,7 @@ message_with_string (m, string, log) | |||
| 6091 | args[1] = message = string; | 6091 | args[1] = message = string; |
| 6092 | GCPRO2 (args[0], message); | 6092 | GCPRO2 (args[0], message); |
| 6093 | gcpro1.nvars = 2; | 6093 | gcpro1.nvars = 2; |
| 6094 | 6094 | ||
| 6095 | message = Fformat (2, args); | 6095 | message = Fformat (2, args); |
| 6096 | 6096 | ||
| 6097 | if (log) | 6097 | if (log) |
| @@ -6206,7 +6206,7 @@ update_echo_area () | |||
| 6206 | { | 6206 | { |
| 6207 | Lisp_Object string; | 6207 | Lisp_Object string; |
| 6208 | string = Fcurrent_message (); | 6208 | string = Fcurrent_message (); |
| 6209 | message3 (string, SBYTES (string), | 6209 | message3 (string, SBYTES (string), |
| 6210 | !NILP (current_buffer->enable_multibyte_characters)); | 6210 | !NILP (current_buffer->enable_multibyte_characters)); |
| 6211 | } | 6211 | } |
| 6212 | } | 6212 | } |
| @@ -6273,7 +6273,7 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4) | |||
| 6273 | ensure_echo_area_buffers (); | 6273 | ensure_echo_area_buffers (); |
| 6274 | 6274 | ||
| 6275 | clear_buffer_p = 0; | 6275 | clear_buffer_p = 0; |
| 6276 | 6276 | ||
| 6277 | if (which == 0) | 6277 | if (which == 0) |
| 6278 | this_one = 0, the_other = 1; | 6278 | this_one = 0, the_other = 1; |
| 6279 | else if (which > 0) | 6279 | else if (which > 0) |
| @@ -6282,7 +6282,7 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4) | |||
| 6282 | { | 6282 | { |
| 6283 | this_one = 0, the_other = 1; | 6283 | this_one = 0, the_other = 1; |
| 6284 | clear_buffer_p = 1; | 6284 | clear_buffer_p = 1; |
| 6285 | 6285 | ||
| 6286 | /* We need a fresh one in case the current echo buffer equals | 6286 | /* We need a fresh one in case the current echo buffer equals |
| 6287 | the one containing the last displayed echo area message. */ | 6287 | the one containing the last displayed echo area message. */ |
| 6288 | if (!NILP (echo_area_buffer[this_one]) | 6288 | if (!NILP (echo_area_buffer[this_one]) |
| @@ -6360,14 +6360,14 @@ with_echo_area_buffer_unwind_data (w) | |||
| 6360 | Vwith_echo_area_save_vector. */ | 6360 | Vwith_echo_area_save_vector. */ |
| 6361 | vector = Vwith_echo_area_save_vector; | 6361 | vector = Vwith_echo_area_save_vector; |
| 6362 | Vwith_echo_area_save_vector = Qnil; | 6362 | Vwith_echo_area_save_vector = Qnil; |
| 6363 | 6363 | ||
| 6364 | if (NILP (vector)) | 6364 | if (NILP (vector)) |
| 6365 | vector = Fmake_vector (make_number (7), Qnil); | 6365 | vector = Fmake_vector (make_number (7), Qnil); |
| 6366 | 6366 | ||
| 6367 | XSETBUFFER (AREF (vector, i), current_buffer); ++i; | 6367 | XSETBUFFER (AREF (vector, i), current_buffer); ++i; |
| 6368 | AREF (vector, i) = Vdeactivate_mark, ++i; | 6368 | AREF (vector, i) = Vdeactivate_mark, ++i; |
| 6369 | AREF (vector, i) = make_number (windows_or_buffers_changed), ++i; | 6369 | AREF (vector, i) = make_number (windows_or_buffers_changed), ++i; |
| 6370 | 6370 | ||
| 6371 | if (w) | 6371 | if (w) |
| 6372 | { | 6372 | { |
| 6373 | XSETWINDOW (AREF (vector, i), w); ++i; | 6373 | XSETWINDOW (AREF (vector, i), w); ++i; |
| @@ -6402,12 +6402,12 @@ unwind_with_echo_area_buffer (vector) | |||
| 6402 | { | 6402 | { |
| 6403 | struct window *w; | 6403 | struct window *w; |
| 6404 | Lisp_Object buffer, charpos, bytepos; | 6404 | Lisp_Object buffer, charpos, bytepos; |
| 6405 | 6405 | ||
| 6406 | w = XWINDOW (AREF (vector, 3)); | 6406 | w = XWINDOW (AREF (vector, 3)); |
| 6407 | buffer = AREF (vector, 4); | 6407 | buffer = AREF (vector, 4); |
| 6408 | charpos = AREF (vector, 5); | 6408 | charpos = AREF (vector, 5); |
| 6409 | bytepos = AREF (vector, 6); | 6409 | bytepos = AREF (vector, 6); |
| 6410 | 6410 | ||
| 6411 | w->buffer = buffer; | 6411 | w->buffer = buffer; |
| 6412 | set_marker_both (w->pointm, buffer, | 6412 | set_marker_both (w->pointm, buffer, |
| 6413 | XFASTINT (charpos), XFASTINT (bytepos)); | 6413 | XFASTINT (charpos), XFASTINT (bytepos)); |
| @@ -6432,14 +6432,14 @@ setup_echo_area_for_printing (multibyte_p) | |||
| 6432 | /* A message has been output since the last time we printed. | 6432 | /* A message has been output since the last time we printed. |
| 6433 | Choose a fresh echo area buffer. */ | 6433 | Choose a fresh echo area buffer. */ |
| 6434 | if (EQ (echo_area_buffer[1], echo_buffer[0])) | 6434 | if (EQ (echo_area_buffer[1], echo_buffer[0])) |
| 6435 | echo_area_buffer[0] = echo_buffer[1]; | 6435 | echo_area_buffer[0] = echo_buffer[1]; |
| 6436 | else | 6436 | else |
| 6437 | echo_area_buffer[0] = echo_buffer[0]; | 6437 | echo_area_buffer[0] = echo_buffer[0]; |
| 6438 | 6438 | ||
| 6439 | /* Switch to that buffer and clear it. */ | 6439 | /* Switch to that buffer and clear it. */ |
| 6440 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); | 6440 | set_buffer_internal (XBUFFER (echo_area_buffer[0])); |
| 6441 | current_buffer->truncate_lines = Qnil; | 6441 | current_buffer->truncate_lines = Qnil; |
| 6442 | 6442 | ||
| 6443 | if (Z > BEG) | 6443 | if (Z > BEG) |
| 6444 | { | 6444 | { |
| 6445 | int count = BINDING_STACK_SIZE (); | 6445 | int count = BINDING_STACK_SIZE (); |
| @@ -6471,11 +6471,11 @@ setup_echo_area_for_printing (multibyte_p) | |||
| 6471 | if (NILP (echo_area_buffer[0])) | 6471 | if (NILP (echo_area_buffer[0])) |
| 6472 | { | 6472 | { |
| 6473 | if (EQ (echo_area_buffer[1], echo_buffer[0])) | 6473 | if (EQ (echo_area_buffer[1], echo_buffer[0])) |
| 6474 | echo_area_buffer[0] = echo_buffer[1]; | 6474 | echo_area_buffer[0] = echo_buffer[1]; |
| 6475 | else | 6475 | else |
| 6476 | echo_area_buffer[0] = echo_buffer[0]; | 6476 | echo_area_buffer[0] = echo_buffer[0]; |
| 6477 | } | 6477 | } |
| 6478 | 6478 | ||
| 6479 | if (current_buffer != XBUFFER (echo_area_buffer[0])) | 6479 | if (current_buffer != XBUFFER (echo_area_buffer[0])) |
| 6480 | { | 6480 | { |
| 6481 | /* Someone switched buffers between print requests. */ | 6481 | /* Someone switched buffers between print requests. */ |
| @@ -6510,7 +6510,7 @@ display_echo_area (w) | |||
| 6510 | with_echo_area_buffer will sets it to an empty buffer. */ | 6510 | with_echo_area_buffer will sets it to an empty buffer. */ |
| 6511 | i = display_last_displayed_message_p ? 1 : 0; | 6511 | i = display_last_displayed_message_p ? 1 : 0; |
| 6512 | no_message_p = NILP (echo_area_buffer[i]); | 6512 | no_message_p = NILP (echo_area_buffer[i]); |
| 6513 | 6513 | ||
| 6514 | window_height_changed_p | 6514 | window_height_changed_p |
| 6515 | = with_echo_area_buffer (w, display_last_displayed_message_p, | 6515 | = with_echo_area_buffer (w, display_last_displayed_message_p, |
| 6516 | display_echo_area_1, | 6516 | display_echo_area_1, |
| @@ -6573,7 +6573,7 @@ resize_echo_area_exactly () | |||
| 6573 | resize_exactly = Qt; | 6573 | resize_exactly = Qt; |
| 6574 | else | 6574 | else |
| 6575 | resize_exactly = Qnil; | 6575 | resize_exactly = Qnil; |
| 6576 | 6576 | ||
| 6577 | resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, | 6577 | resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, |
| 6578 | (EMACS_INT) w, resize_exactly, 0, 0); | 6578 | (EMACS_INT) w, resize_exactly, 0, 0); |
| 6579 | if (resized_p) | 6579 | if (resized_p) |
| @@ -6625,12 +6625,12 @@ resize_mini_window (w, exact_p) | |||
| 6625 | functions with safe_call which binds inhibit-redisplay to t. */ | 6625 | functions with safe_call which binds inhibit-redisplay to t. */ |
| 6626 | if (!NILP (Vinhibit_redisplay)) | 6626 | if (!NILP (Vinhibit_redisplay)) |
| 6627 | return 0; | 6627 | return 0; |
| 6628 | 6628 | ||
| 6629 | /* Nil means don't try to resize. */ | 6629 | /* Nil means don't try to resize. */ |
| 6630 | if (NILP (Vresize_mini_windows) | 6630 | if (NILP (Vresize_mini_windows) |
| 6631 | || (FRAME_X_P (f) && f->output_data.x == NULL)) | 6631 | || (FRAME_X_P (f) && f->output_data.x == NULL)) |
| 6632 | return 0; | 6632 | return 0; |
| 6633 | 6633 | ||
| 6634 | if (!FRAME_MINIBUF_ONLY_P (f)) | 6634 | if (!FRAME_MINIBUF_ONLY_P (f)) |
| 6635 | { | 6635 | { |
| 6636 | struct it it; | 6636 | struct it it; |
| @@ -6656,11 +6656,11 @@ resize_mini_window (w, exact_p) | |||
| 6656 | max_height = XINT (Vmax_mini_window_height); | 6656 | max_height = XINT (Vmax_mini_window_height); |
| 6657 | else | 6657 | else |
| 6658 | max_height = total_height / 4; | 6658 | max_height = total_height / 4; |
| 6659 | 6659 | ||
| 6660 | /* Correct that max. height if it's bogus. */ | 6660 | /* Correct that max. height if it's bogus. */ |
| 6661 | max_height = max (1, max_height); | 6661 | max_height = max (1, max_height); |
| 6662 | max_height = min (total_height, max_height); | 6662 | max_height = min (total_height, max_height); |
| 6663 | 6663 | ||
| 6664 | /* Find out the height of the text in the window. */ | 6664 | /* Find out the height of the text in the window. */ |
| 6665 | if (it.truncate_lines_p) | 6665 | if (it.truncate_lines_p) |
| 6666 | height = 1; | 6666 | height = 1; |
| @@ -6675,7 +6675,7 @@ resize_mini_window (w, exact_p) | |||
| 6675 | height -= it.extra_line_spacing; | 6675 | height -= it.extra_line_spacing; |
| 6676 | height = (height + unit - 1) / unit; | 6676 | height = (height + unit - 1) / unit; |
| 6677 | } | 6677 | } |
| 6678 | 6678 | ||
| 6679 | /* Compute a suitable window start. */ | 6679 | /* Compute a suitable window start. */ |
| 6680 | if (height > max_height) | 6680 | if (height > max_height) |
| 6681 | { | 6681 | { |
| @@ -6708,7 +6708,7 @@ resize_mini_window (w, exact_p) | |||
| 6708 | window_height_changed_p = XFASTINT (w->height) != old_height; | 6708 | window_height_changed_p = XFASTINT (w->height) != old_height; |
| 6709 | } | 6709 | } |
| 6710 | } | 6710 | } |
| 6711 | else | 6711 | else |
| 6712 | { | 6712 | { |
| 6713 | /* Always resize to exact size needed. */ | 6713 | /* Always resize to exact size needed. */ |
| 6714 | if (height > XFASTINT (w->height)) | 6714 | if (height > XFASTINT (w->height)) |
| @@ -6729,7 +6729,7 @@ resize_mini_window (w, exact_p) | |||
| 6729 | freeze_window_starts (f, 1); | 6729 | freeze_window_starts (f, 1); |
| 6730 | grow_mini_window (w, height - XFASTINT (w->height)); | 6730 | grow_mini_window (w, height - XFASTINT (w->height)); |
| 6731 | } | 6731 | } |
| 6732 | 6732 | ||
| 6733 | window_height_changed_p = XFASTINT (w->height) != old_height; | 6733 | window_height_changed_p = XFASTINT (w->height) != old_height; |
| 6734 | } | 6734 | } |
| 6735 | } | 6735 | } |
| @@ -6759,7 +6759,7 @@ current_message () | |||
| 6759 | if (NILP (msg)) | 6759 | if (NILP (msg)) |
| 6760 | echo_area_buffer[0] = Qnil; | 6760 | echo_area_buffer[0] = Qnil; |
| 6761 | } | 6761 | } |
| 6762 | 6762 | ||
| 6763 | return msg; | 6763 | return msg; |
| 6764 | } | 6764 | } |
| 6765 | 6765 | ||
| @@ -6771,7 +6771,7 @@ current_message_1 (a1, a2, a3, a4) | |||
| 6771 | EMACS_INT a3, a4; | 6771 | EMACS_INT a3, a4; |
| 6772 | { | 6772 | { |
| 6773 | Lisp_Object *msg = (Lisp_Object *) a1; | 6773 | Lisp_Object *msg = (Lisp_Object *) a1; |
| 6774 | 6774 | ||
| 6775 | if (Z > BEG) | 6775 | if (Z > BEG) |
| 6776 | *msg = make_buffer_string (BEG, Z, 1); | 6776 | *msg = make_buffer_string (BEG, Z, 1); |
| 6777 | else | 6777 | else |
| @@ -6812,7 +6812,7 @@ void | |||
| 6812 | restore_message () | 6812 | restore_message () |
| 6813 | { | 6813 | { |
| 6814 | Lisp_Object msg; | 6814 | Lisp_Object msg; |
| 6815 | 6815 | ||
| 6816 | xassert (CONSP (Vmessage_stack)); | 6816 | xassert (CONSP (Vmessage_stack)); |
| 6817 | msg = XCAR (Vmessage_stack); | 6817 | msg = XCAR (Vmessage_stack); |
| 6818 | if (STRINGP (msg)) | 6818 | if (STRINGP (msg)) |
| @@ -6903,7 +6903,7 @@ set_message (s, string, nbytes, multibyte_p) | |||
| 6903 | message_enable_multibyte | 6903 | message_enable_multibyte |
| 6904 | = ((s && multibyte_p) | 6904 | = ((s && multibyte_p) |
| 6905 | || (STRINGP (string) && STRING_MULTIBYTE (string))); | 6905 | || (STRINGP (string) && STRING_MULTIBYTE (string))); |
| 6906 | 6906 | ||
| 6907 | with_echo_area_buffer (0, -1, set_message_1, | 6907 | with_echo_area_buffer (0, -1, set_message_1, |
| 6908 | (EMACS_INT) s, string, nbytes, multibyte_p); | 6908 | (EMACS_INT) s, string, nbytes, multibyte_p); |
| 6909 | message_buf_print = 0; | 6909 | message_buf_print = 0; |
| @@ -6924,27 +6924,27 @@ set_message_1 (a1, a2, nbytes, multibyte_p) | |||
| 6924 | { | 6924 | { |
| 6925 | char *s = (char *) a1; | 6925 | char *s = (char *) a1; |
| 6926 | Lisp_Object string = a2; | 6926 | Lisp_Object string = a2; |
| 6927 | 6927 | ||
| 6928 | xassert (BEG == Z); | 6928 | xassert (BEG == Z); |
| 6929 | 6929 | ||
| 6930 | /* Change multibyteness of the echo buffer appropriately. */ | 6930 | /* Change multibyteness of the echo buffer appropriately. */ |
| 6931 | if (message_enable_multibyte | 6931 | if (message_enable_multibyte |
| 6932 | != !NILP (current_buffer->enable_multibyte_characters)) | 6932 | != !NILP (current_buffer->enable_multibyte_characters)) |
| 6933 | Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); | 6933 | Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); |
| 6934 | 6934 | ||
| 6935 | current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil; | 6935 | current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil; |
| 6936 | 6936 | ||
| 6937 | /* Insert new message at BEG. */ | 6937 | /* Insert new message at BEG. */ |
| 6938 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 6938 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
| 6939 | 6939 | ||
| 6940 | if (STRINGP (string)) | 6940 | if (STRINGP (string)) |
| 6941 | { | 6941 | { |
| 6942 | int nchars; | 6942 | int nchars; |
| 6943 | 6943 | ||
| 6944 | if (nbytes == 0) | 6944 | if (nbytes == 0) |
| 6945 | nbytes = SBYTES (string); | 6945 | nbytes = SBYTES (string); |
| 6946 | nchars = string_byte_to_char (string, nbytes); | 6946 | nchars = string_byte_to_char (string, nbytes); |
| 6947 | 6947 | ||
| 6948 | /* This function takes care of single/multibyte conversion. We | 6948 | /* This function takes care of single/multibyte conversion. We |
| 6949 | just have to ensure that the echo area buffer has the right | 6949 | just have to ensure that the echo area buffer has the right |
| 6950 | setting of enable_multibyte_characters. */ | 6950 | setting of enable_multibyte_characters. */ |
| @@ -6954,13 +6954,13 @@ set_message_1 (a1, a2, nbytes, multibyte_p) | |||
| 6954 | { | 6954 | { |
| 6955 | if (nbytes == 0) | 6955 | if (nbytes == 0) |
| 6956 | nbytes = strlen (s); | 6956 | nbytes = strlen (s); |
| 6957 | 6957 | ||
| 6958 | if (multibyte_p && NILP (current_buffer->enable_multibyte_characters)) | 6958 | if (multibyte_p && NILP (current_buffer->enable_multibyte_characters)) |
| 6959 | { | 6959 | { |
| 6960 | /* Convert from multi-byte to single-byte. */ | 6960 | /* Convert from multi-byte to single-byte. */ |
| 6961 | int i, c, n; | 6961 | int i, c, n; |
| 6962 | unsigned char work[1]; | 6962 | unsigned char work[1]; |
| 6963 | 6963 | ||
| 6964 | /* Convert a multibyte string to single-byte. */ | 6964 | /* Convert a multibyte string to single-byte. */ |
| 6965 | for (i = 0; i < nbytes; i += n) | 6965 | for (i = 0; i < nbytes; i += n) |
| 6966 | { | 6966 | { |
| @@ -6978,7 +6978,7 @@ set_message_1 (a1, a2, nbytes, multibyte_p) | |||
| 6978 | int i, c, n; | 6978 | int i, c, n; |
| 6979 | unsigned char *msg = (unsigned char *) s; | 6979 | unsigned char *msg = (unsigned char *) s; |
| 6980 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 6980 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 6981 | 6981 | ||
| 6982 | /* Convert a single-byte string to multibyte. */ | 6982 | /* Convert a single-byte string to multibyte. */ |
| 6983 | for (i = 0; i < nbytes; i++) | 6983 | for (i = 0; i < nbytes; i++) |
| 6984 | { | 6984 | { |
| @@ -7008,10 +7008,10 @@ clear_message (current_p, last_displayed_p) | |||
| 7008 | echo_area_buffer[0] = Qnil; | 7008 | echo_area_buffer[0] = Qnil; |
| 7009 | message_cleared_p = 1; | 7009 | message_cleared_p = 1; |
| 7010 | } | 7010 | } |
| 7011 | 7011 | ||
| 7012 | if (last_displayed_p) | 7012 | if (last_displayed_p) |
| 7013 | echo_area_buffer[1] = Qnil; | 7013 | echo_area_buffer[1] = Qnil; |
| 7014 | 7014 | ||
| 7015 | message_buf_print = 0; | 7015 | message_buf_print = 0; |
| 7016 | } | 7016 | } |
| 7017 | 7017 | ||
| @@ -7031,11 +7031,11 @@ clear_garbaged_frames () | |||
| 7031 | { | 7031 | { |
| 7032 | Lisp_Object tail, frame; | 7032 | Lisp_Object tail, frame; |
| 7033 | int changed_count = 0; | 7033 | int changed_count = 0; |
| 7034 | 7034 | ||
| 7035 | FOR_EACH_FRAME (tail, frame) | 7035 | FOR_EACH_FRAME (tail, frame) |
| 7036 | { | 7036 | { |
| 7037 | struct frame *f = XFRAME (frame); | 7037 | struct frame *f = XFRAME (frame); |
| 7038 | 7038 | ||
| 7039 | if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) | 7039 | if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) |
| 7040 | { | 7040 | { |
| 7041 | if (f->resized_p) | 7041 | if (f->resized_p) |
| @@ -7082,7 +7082,7 @@ echo_area_display (update_frame_p) | |||
| 7082 | /* When Emacs starts, selected_frame may be a visible terminal | 7082 | /* When Emacs starts, selected_frame may be a visible terminal |
| 7083 | frame, even if we run under a window system. If we let this | 7083 | frame, even if we run under a window system. If we let this |
| 7084 | through, a message would be displayed on the terminal. */ | 7084 | through, a message would be displayed on the terminal. */ |
| 7085 | if (EQ (selected_frame, Vterminal_frame) | 7085 | if (EQ (selected_frame, Vterminal_frame) |
| 7086 | && !NILP (Vwindow_system)) | 7086 | && !NILP (Vwindow_system)) |
| 7087 | return 0; | 7087 | return 0; |
| 7088 | #endif /* HAVE_WINDOW_SYSTEM */ | 7088 | #endif /* HAVE_WINDOW_SYSTEM */ |
| @@ -7113,7 +7113,7 @@ echo_area_display (update_frame_p) | |||
| 7113 | garbaged. This looks odd, so we prevent it here. */ | 7113 | garbaged. This looks odd, so we prevent it here. */ |
| 7114 | if (!display_completed) | 7114 | if (!display_completed) |
| 7115 | n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), 0); | 7115 | n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), 0); |
| 7116 | 7116 | ||
| 7117 | if (window_height_changed_p | 7117 | if (window_height_changed_p |
| 7118 | /* Don't do this if Emacs is shutting down. Redisplay | 7118 | /* Don't do this if Emacs is shutting down. Redisplay |
| 7119 | needs to run hooks. */ | 7119 | needs to run hooks. */ |
| @@ -7151,7 +7151,7 @@ echo_area_display (update_frame_p) | |||
| 7151 | 7151 | ||
| 7152 | /* Last displayed message is now the current message. */ | 7152 | /* Last displayed message is now the current message. */ |
| 7153 | echo_area_buffer[1] = echo_area_buffer[0]; | 7153 | echo_area_buffer[1] = echo_area_buffer[0]; |
| 7154 | 7154 | ||
| 7155 | /* Prevent redisplay optimization in redisplay_internal by resetting | 7155 | /* Prevent redisplay optimization in redisplay_internal by resetting |
| 7156 | this_line_start_pos. This is done because the mini-buffer now | 7156 | this_line_start_pos. This is done because the mini-buffer now |
| 7157 | displays the message instead of its buffer text. */ | 7157 | displays the message instead of its buffer text. */ |
| @@ -7263,7 +7263,7 @@ x_consider_frame_title (frame) | |||
| 7263 | Lisp_Object other_frame = XCAR (tail); | 7263 | Lisp_Object other_frame = XCAR (tail); |
| 7264 | struct frame *tf = XFRAME (other_frame); | 7264 | struct frame *tf = XFRAME (other_frame); |
| 7265 | 7265 | ||
| 7266 | if (tf != f | 7266 | if (tf != f |
| 7267 | && FRAME_KBOARD (tf) == FRAME_KBOARD (f) | 7267 | && FRAME_KBOARD (tf) == FRAME_KBOARD (f) |
| 7268 | && !FRAME_MINIBUF_ONLY_P (tf) | 7268 | && !FRAME_MINIBUF_ONLY_P (tf) |
| 7269 | && !EQ (other_frame, tip_frame) | 7269 | && !EQ (other_frame, tip_frame) |
| @@ -7293,7 +7293,7 @@ x_consider_frame_title (frame) | |||
| 7293 | already wasted too much time by walking through the list with | 7293 | already wasted too much time by walking through the list with |
| 7294 | display_mode_element, then we might need to optimize at a | 7294 | display_mode_element, then we might need to optimize at a |
| 7295 | higher level than this.) */ | 7295 | higher level than this.) */ |
| 7296 | if (! STRINGP (f->name) | 7296 | if (! STRINGP (f->name) |
| 7297 | || SBYTES (f->name) != len | 7297 | || SBYTES (f->name) != len |
| 7298 | || bcmp (frame_title_buf, SDATA (f->name), len) != 0) | 7298 | || bcmp (frame_title_buf, SDATA (f->name), len) != 0) |
| 7299 | x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); | 7299 | x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); |
| @@ -7352,7 +7352,7 @@ prepare_menu_bars () | |||
| 7352 | 7352 | ||
| 7353 | /* Update the menu bar item lists, if appropriate. This has to be | 7353 | /* Update the menu bar item lists, if appropriate. This has to be |
| 7354 | done before any actual redisplay or generation of display lines. */ | 7354 | done before any actual redisplay or generation of display lines. */ |
| 7355 | all_windows = (update_mode_lines | 7355 | all_windows = (update_mode_lines |
| 7356 | || buffer_shared > 1 | 7356 | || buffer_shared > 1 |
| 7357 | || windows_or_buffers_changed); | 7357 | || windows_or_buffers_changed); |
| 7358 | if (all_windows) | 7358 | if (all_windows) |
| @@ -7369,18 +7369,18 @@ prepare_menu_bars () | |||
| 7369 | /* Ignore tooltip frame. */ | 7369 | /* Ignore tooltip frame. */ |
| 7370 | if (EQ (frame, tooltip_frame)) | 7370 | if (EQ (frame, tooltip_frame)) |
| 7371 | continue; | 7371 | continue; |
| 7372 | 7372 | ||
| 7373 | /* If a window on this frame changed size, report that to | 7373 | /* If a window on this frame changed size, report that to |
| 7374 | the user and clear the size-change flag. */ | 7374 | the user and clear the size-change flag. */ |
| 7375 | if (FRAME_WINDOW_SIZES_CHANGED (f)) | 7375 | if (FRAME_WINDOW_SIZES_CHANGED (f)) |
| 7376 | { | 7376 | { |
| 7377 | Lisp_Object functions; | 7377 | Lisp_Object functions; |
| 7378 | 7378 | ||
| 7379 | /* Clear flag first in case we get an error below. */ | 7379 | /* Clear flag first in case we get an error below. */ |
| 7380 | FRAME_WINDOW_SIZES_CHANGED (f) = 0; | 7380 | FRAME_WINDOW_SIZES_CHANGED (f) = 0; |
| 7381 | functions = Vwindow_size_change_functions; | 7381 | functions = Vwindow_size_change_functions; |
| 7382 | GCPRO2 (tail, functions); | 7382 | GCPRO2 (tail, functions); |
| 7383 | 7383 | ||
| 7384 | while (CONSP (functions)) | 7384 | while (CONSP (functions)) |
| 7385 | { | 7385 | { |
| 7386 | call1 (XCAR (functions), frame); | 7386 | call1 (XCAR (functions), frame); |
| @@ -7388,7 +7388,7 @@ prepare_menu_bars () | |||
| 7388 | } | 7388 | } |
| 7389 | UNGCPRO; | 7389 | UNGCPRO; |
| 7390 | } | 7390 | } |
| 7391 | 7391 | ||
| 7392 | GCPRO1 (tail); | 7392 | GCPRO1 (tail); |
| 7393 | update_menu_bar (f, 0); | 7393 | update_menu_bar (f, 0); |
| 7394 | #ifdef HAVE_WINDOW_SYSTEM | 7394 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -7438,12 +7438,12 @@ update_menu_bar (f, save_match_data) | |||
| 7438 | 7438 | ||
| 7439 | window = FRAME_SELECTED_WINDOW (f); | 7439 | window = FRAME_SELECTED_WINDOW (f); |
| 7440 | w = XWINDOW (window); | 7440 | w = XWINDOW (window); |
| 7441 | 7441 | ||
| 7442 | #if 0 /* The if statement below this if statement used to include the | 7442 | #if 0 /* The if statement below this if statement used to include the |
| 7443 | condition !NILP (w->update_mode_line), rather than using | 7443 | condition !NILP (w->update_mode_line), rather than using |
| 7444 | update_mode_lines directly, and this if statement may have | 7444 | update_mode_lines directly, and this if statement may have |
| 7445 | been added to make that condition work. Now the if | 7445 | been added to make that condition work. Now the if |
| 7446 | statement below matches its comment, this isn't needed. */ | 7446 | statement below matches its comment, this isn't needed. */ |
| 7447 | if (update_mode_lines) | 7447 | if (update_mode_lines) |
| 7448 | w->update_mode_line = Qt; | 7448 | w->update_mode_line = Qt; |
| 7449 | #endif | 7449 | #endif |
| @@ -7451,7 +7451,7 @@ update_menu_bar (f, save_match_data) | |||
| 7451 | if (FRAME_WINDOW_P (f) | 7451 | if (FRAME_WINDOW_P (f) |
| 7452 | ? | 7452 | ? |
| 7453 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) | 7453 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) |
| 7454 | FRAME_EXTERNAL_MENU_BAR (f) | 7454 | FRAME_EXTERNAL_MENU_BAR (f) |
| 7455 | #else | 7455 | #else |
| 7456 | FRAME_MENU_BAR_LINES (f) > 0 | 7456 | FRAME_MENU_BAR_LINES (f) > 0 |
| 7457 | #endif | 7457 | #endif |
| @@ -7491,15 +7491,15 @@ update_menu_bar (f, save_match_data) | |||
| 7491 | 7491 | ||
| 7492 | /* Run the Lucid hook. */ | 7492 | /* Run the Lucid hook. */ |
| 7493 | safe_run_hooks (Qactivate_menubar_hook); | 7493 | safe_run_hooks (Qactivate_menubar_hook); |
| 7494 | 7494 | ||
| 7495 | /* If it has changed current-menubar from previous value, | 7495 | /* If it has changed current-menubar from previous value, |
| 7496 | really recompute the menu-bar from the value. */ | 7496 | really recompute the menu-bar from the value. */ |
| 7497 | if (! NILP (Vlucid_menu_bar_dirty_flag)) | 7497 | if (! NILP (Vlucid_menu_bar_dirty_flag)) |
| 7498 | call0 (Qrecompute_lucid_menubar); | 7498 | call0 (Qrecompute_lucid_menubar); |
| 7499 | 7499 | ||
| 7500 | safe_run_hooks (Qmenu_bar_update_hook); | 7500 | safe_run_hooks (Qmenu_bar_update_hook); |
| 7501 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); | 7501 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); |
| 7502 | 7502 | ||
| 7503 | /* Redisplay the menu bar in case we changed it. */ | 7503 | /* Redisplay the menu bar in case we changed it. */ |
| 7504 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) | 7504 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) |
| 7505 | if (FRAME_WINDOW_P (f) | 7505 | if (FRAME_WINDOW_P (f) |
| @@ -7552,7 +7552,7 @@ update_tool_bar (f, save_match_data) | |||
| 7552 | 7552 | ||
| 7553 | window = FRAME_SELECTED_WINDOW (f); | 7553 | window = FRAME_SELECTED_WINDOW (f); |
| 7554 | w = XWINDOW (window); | 7554 | w = XWINDOW (window); |
| 7555 | 7555 | ||
| 7556 | /* If the user has switched buffers or windows, we need to | 7556 | /* If the user has switched buffers or windows, we need to |
| 7557 | recompute to reflect the new bindings. But we'll | 7557 | recompute to reflect the new bindings. But we'll |
| 7558 | recompute when update_mode_lines is set too; that means | 7558 | recompute when update_mode_lines is set too; that means |
| @@ -7591,7 +7591,7 @@ update_tool_bar (f, save_match_data) | |||
| 7591 | /* Build desired tool-bar items from keymaps. */ | 7591 | /* Build desired tool-bar items from keymaps. */ |
| 7592 | f->tool_bar_items | 7592 | f->tool_bar_items |
| 7593 | = tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items); | 7593 | = tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items); |
| 7594 | 7594 | ||
| 7595 | /* Redisplay the tool-bar in case we changed it. */ | 7595 | /* Redisplay the tool-bar in case we changed it. */ |
| 7596 | w->update_mode_line = Qt; | 7596 | w->update_mode_line = Qt; |
| 7597 | 7597 | ||
| @@ -7619,7 +7619,7 @@ build_desired_tool_bar_string (f) | |||
| 7619 | 7619 | ||
| 7620 | /* Prepare F->desired_tool_bar_string. If we can reuse it, do so. | 7620 | /* Prepare F->desired_tool_bar_string. If we can reuse it, do so. |
| 7621 | Otherwise, make a new string. */ | 7621 | Otherwise, make a new string. */ |
| 7622 | 7622 | ||
| 7623 | /* The size of the string we might be able to reuse. */ | 7623 | /* The size of the string we might be able to reuse. */ |
| 7624 | size = (STRINGP (f->desired_tool_bar_string) | 7624 | size = (STRINGP (f->desired_tool_bar_string) |
| 7625 | ? SCHARS (f->desired_tool_bar_string) | 7625 | ? SCHARS (f->desired_tool_bar_string) |
| @@ -7627,7 +7627,7 @@ build_desired_tool_bar_string (f) | |||
| 7627 | 7627 | ||
| 7628 | /* We need one space in the string for each image. */ | 7628 | /* We need one space in the string for each image. */ |
| 7629 | size_needed = f->n_tool_bar_items; | 7629 | size_needed = f->n_tool_bar_items; |
| 7630 | 7630 | ||
| 7631 | /* Reuse f->desired_tool_bar_string, if possible. */ | 7631 | /* Reuse f->desired_tool_bar_string, if possible. */ |
| 7632 | if (size < size_needed || NILP (f->desired_tool_bar_string)) | 7632 | if (size < size_needed || NILP (f->desired_tool_bar_string)) |
| 7633 | f->desired_tool_bar_string = Fmake_string (make_number (size_needed), | 7633 | f->desired_tool_bar_string = Fmake_string (make_number (size_needed), |
| @@ -7664,7 +7664,7 @@ build_desired_tool_bar_string (f) | |||
| 7664 | idx = (selected_p | 7664 | idx = (selected_p |
| 7665 | ? TOOL_BAR_IMAGE_DISABLED_SELECTED | 7665 | ? TOOL_BAR_IMAGE_DISABLED_SELECTED |
| 7666 | : TOOL_BAR_IMAGE_DISABLED_DESELECTED); | 7666 | : TOOL_BAR_IMAGE_DISABLED_DESELECTED); |
| 7667 | 7667 | ||
| 7668 | xassert (ASIZE (image) >= idx); | 7668 | xassert (ASIZE (image) >= idx); |
| 7669 | image = AREF (image, idx); | 7669 | image = AREF (image, idx); |
| 7670 | } | 7670 | } |
| @@ -7695,12 +7695,12 @@ build_desired_tool_bar_string (f) | |||
| 7695 | if (INTEGERP (XCAR (Vtool_bar_button_margin)) | 7695 | if (INTEGERP (XCAR (Vtool_bar_button_margin)) |
| 7696 | && XINT (XCAR (Vtool_bar_button_margin)) > 0) | 7696 | && XINT (XCAR (Vtool_bar_button_margin)) > 0) |
| 7697 | hmargin += XFASTINT (XCAR (Vtool_bar_button_margin)); | 7697 | hmargin += XFASTINT (XCAR (Vtool_bar_button_margin)); |
| 7698 | 7698 | ||
| 7699 | if (INTEGERP (XCDR (Vtool_bar_button_margin)) | 7699 | if (INTEGERP (XCDR (Vtool_bar_button_margin)) |
| 7700 | && XINT (XCDR (Vtool_bar_button_margin)) > 0) | 7700 | && XINT (XCDR (Vtool_bar_button_margin)) > 0) |
| 7701 | vmargin += XFASTINT (XCDR (Vtool_bar_button_margin)); | 7701 | vmargin += XFASTINT (XCDR (Vtool_bar_button_margin)); |
| 7702 | } | 7702 | } |
| 7703 | 7703 | ||
| 7704 | if (auto_raise_tool_bar_buttons_p) | 7704 | if (auto_raise_tool_bar_buttons_p) |
| 7705 | { | 7705 | { |
| 7706 | /* Add a `:relief' property to the image spec if the item is | 7706 | /* Add a `:relief' property to the image spec if the item is |
| @@ -7735,13 +7735,13 @@ build_desired_tool_bar_string (f) | |||
| 7735 | Fcons (make_number (hmargin), | 7735 | Fcons (make_number (hmargin), |
| 7736 | make_number (vmargin))); | 7736 | make_number (vmargin))); |
| 7737 | } | 7737 | } |
| 7738 | 7738 | ||
| 7739 | /* If button is not enabled, and we don't have special images | 7739 | /* If button is not enabled, and we don't have special images |
| 7740 | for the disabled state, make the image appear disabled by | 7740 | for the disabled state, make the image appear disabled by |
| 7741 | applying an appropriate algorithm to it. */ | 7741 | applying an appropriate algorithm to it. */ |
| 7742 | if (!enabled_p && idx < 0) | 7742 | if (!enabled_p && idx < 0) |
| 7743 | plist = Fplist_put (plist, QCconversion, Qdisabled); | 7743 | plist = Fplist_put (plist, QCconversion, Qdisabled); |
| 7744 | 7744 | ||
| 7745 | /* Put a `display' text property on the string for the image to | 7745 | /* Put a `display' text property on the string for the image to |
| 7746 | display. Put a `menu-item' property on the string that gives | 7746 | display. Put a `menu-item' property on the string that gives |
| 7747 | the start of this item's properties in the tool-bar items | 7747 | the start of this item's properties in the tool-bar items |
| @@ -7775,14 +7775,14 @@ display_tool_bar_line (it) | |||
| 7775 | struct glyph_row *row = it->glyph_row; | 7775 | struct glyph_row *row = it->glyph_row; |
| 7776 | int max_x = it->last_visible_x; | 7776 | int max_x = it->last_visible_x; |
| 7777 | struct glyph *last; | 7777 | struct glyph *last; |
| 7778 | 7778 | ||
| 7779 | prepare_desired_row (row); | 7779 | prepare_desired_row (row); |
| 7780 | row->y = it->current_y; | 7780 | row->y = it->current_y; |
| 7781 | 7781 | ||
| 7782 | /* Note that this isn't made use of if the face hasn't a box, | 7782 | /* Note that this isn't made use of if the face hasn't a box, |
| 7783 | so there's no need to check the face here. */ | 7783 | so there's no need to check the face here. */ |
| 7784 | it->start_of_box_run_p = 1; | 7784 | it->start_of_box_run_p = 1; |
| 7785 | 7785 | ||
| 7786 | while (it->current_x < max_x) | 7786 | while (it->current_x < max_x) |
| 7787 | { | 7787 | { |
| 7788 | int x_before, x, n_glyphs_before, i, nglyphs; | 7788 | int x_before, x, n_glyphs_before, i, nglyphs; |
| @@ -7802,7 +7802,7 @@ display_tool_bar_line (it) | |||
| 7802 | while (i < nglyphs) | 7802 | while (i < nglyphs) |
| 7803 | { | 7803 | { |
| 7804 | struct glyph *glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; | 7804 | struct glyph *glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; |
| 7805 | 7805 | ||
| 7806 | if (x + glyph->pixel_width > max_x) | 7806 | if (x + glyph->pixel_width > max_x) |
| 7807 | { | 7807 | { |
| 7808 | /* Glyph doesn't fit on line. */ | 7808 | /* Glyph doesn't fit on line. */ |
| @@ -7832,14 +7832,14 @@ display_tool_bar_line (it) | |||
| 7832 | if (last == row->glyphs[TEXT_AREA]) | 7832 | if (last == row->glyphs[TEXT_AREA]) |
| 7833 | last->left_box_line_p = 1; | 7833 | last->left_box_line_p = 1; |
| 7834 | compute_line_metrics (it); | 7834 | compute_line_metrics (it); |
| 7835 | 7835 | ||
| 7836 | /* If line is empty, make it occupy the rest of the tool-bar. */ | 7836 | /* If line is empty, make it occupy the rest of the tool-bar. */ |
| 7837 | if (!row->displays_text_p) | 7837 | if (!row->displays_text_p) |
| 7838 | { | 7838 | { |
| 7839 | row->height = row->phys_height = it->last_visible_y - row->y; | 7839 | row->height = row->phys_height = it->last_visible_y - row->y; |
| 7840 | row->ascent = row->phys_ascent = 0; | 7840 | row->ascent = row->phys_ascent = 0; |
| 7841 | } | 7841 | } |
| 7842 | 7842 | ||
| 7843 | row->full_width_p = 1; | 7843 | row->full_width_p = 1; |
| 7844 | row->continued_p = 0; | 7844 | row->continued_p = 0; |
| 7845 | row->truncated_on_left_p = 0; | 7845 | row->truncated_on_left_p = 0; |
| @@ -7861,7 +7861,7 @@ tool_bar_lines_needed (f) | |||
| 7861 | { | 7861 | { |
| 7862 | struct window *w = XWINDOW (f->tool_bar_window); | 7862 | struct window *w = XWINDOW (f->tool_bar_window); |
| 7863 | struct it it; | 7863 | struct it it; |
| 7864 | 7864 | ||
| 7865 | /* Initialize an iterator for iteration over | 7865 | /* Initialize an iterator for iteration over |
| 7866 | F->desired_tool_bar_string in the tool-bar window of frame F. */ | 7866 | F->desired_tool_bar_string in the tool-bar window of frame F. */ |
| 7867 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); | 7867 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); |
| @@ -7895,7 +7895,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, | |||
| 7895 | else | 7895 | else |
| 7896 | CHECK_FRAME (frame); | 7896 | CHECK_FRAME (frame); |
| 7897 | f = XFRAME (frame); | 7897 | f = XFRAME (frame); |
| 7898 | 7898 | ||
| 7899 | if (WINDOWP (f->tool_bar_window) | 7899 | if (WINDOWP (f->tool_bar_window) |
| 7900 | || (w = XWINDOW (f->tool_bar_window), | 7900 | || (w = XWINDOW (f->tool_bar_window), |
| 7901 | XFASTINT (w->height) > 0)) | 7901 | XFASTINT (w->height) > 0)) |
| @@ -7923,7 +7923,7 @@ redisplay_tool_bar (f) | |||
| 7923 | struct it it; | 7923 | struct it it; |
| 7924 | struct glyph_row *row; | 7924 | struct glyph_row *row; |
| 7925 | int change_height_p = 0; | 7925 | int change_height_p = 0; |
| 7926 | 7926 | ||
| 7927 | /* If frame hasn't a tool-bar window or if it is zero-height, don't | 7927 | /* If frame hasn't a tool-bar window or if it is zero-height, don't |
| 7928 | do anything. This means you must start with tool-bar-lines | 7928 | do anything. This means you must start with tool-bar-lines |
| 7929 | non-zero to get the auto-sizing effect. Or in other words, you | 7929 | non-zero to get the auto-sizing effect. Or in other words, you |
| @@ -7960,7 +7960,7 @@ redisplay_tool_bar (f) | |||
| 7960 | height. */ | 7960 | height. */ |
| 7961 | if (IT_STRING_CHARPOS (it) < it.end_charpos) | 7961 | if (IT_STRING_CHARPOS (it) < it.end_charpos) |
| 7962 | change_height_p = 1; | 7962 | change_height_p = 1; |
| 7963 | 7963 | ||
| 7964 | /* If there are blank lines at the end, except for a partially | 7964 | /* If there are blank lines at the end, except for a partially |
| 7965 | visible blank line at the end that is smaller than | 7965 | visible blank line at the end that is smaller than |
| 7966 | CANON_Y_UNIT, change the tool-bar's height. */ | 7966 | CANON_Y_UNIT, change the tool-bar's height. */ |
| @@ -7984,7 +7984,7 @@ redisplay_tool_bar (f) | |||
| 7984 | extern Lisp_Object Qtool_bar_lines; | 7984 | extern Lisp_Object Qtool_bar_lines; |
| 7985 | Lisp_Object frame; | 7985 | Lisp_Object frame; |
| 7986 | int old_height = XFASTINT (w->height); | 7986 | int old_height = XFASTINT (w->height); |
| 7987 | 7987 | ||
| 7988 | XSETFRAME (frame, f); | 7988 | XSETFRAME (frame, f); |
| 7989 | clear_glyph_matrix (w->desired_matrix); | 7989 | clear_glyph_matrix (w->desired_matrix); |
| 7990 | Fmodify_frame_parameters (frame, | 7990 | Fmodify_frame_parameters (frame, |
| @@ -8020,7 +8020,7 @@ tool_bar_item_info (f, glyph, prop_idx) | |||
| 8020 | error. */ | 8020 | error. */ |
| 8021 | charpos = min (SCHARS (f->current_tool_bar_string), glyph->charpos); | 8021 | charpos = min (SCHARS (f->current_tool_bar_string), glyph->charpos); |
| 8022 | charpos = max (0, charpos); | 8022 | charpos = max (0, charpos); |
| 8023 | 8023 | ||
| 8024 | /* Get the text property `menu-item' at pos. The value of that | 8024 | /* Get the text property `menu-item' at pos. The value of that |
| 8025 | property is the start index of this item's properties in | 8025 | property is the start index of this item's properties in |
| 8026 | F->tool_bar_items. */ | 8026 | F->tool_bar_items. */ |
| @@ -8036,7 +8036,7 @@ tool_bar_item_info (f, glyph, prop_idx) | |||
| 8036 | 8036 | ||
| 8037 | return success_p; | 8037 | return success_p; |
| 8038 | } | 8038 | } |
| 8039 | 8039 | ||
| 8040 | #endif /* HAVE_WINDOW_SYSTEM */ | 8040 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 8041 | 8041 | ||
| 8042 | 8042 | ||
| @@ -8200,7 +8200,7 @@ hscroll_windows (window) | |||
| 8200 | Lisp_Object window; | 8200 | Lisp_Object window; |
| 8201 | { | 8201 | { |
| 8202 | int hscrolled_p; | 8202 | int hscrolled_p; |
| 8203 | 8203 | ||
| 8204 | if (automatic_hscrolling_p) | 8204 | if (automatic_hscrolling_p) |
| 8205 | { | 8205 | { |
| 8206 | hscrolled_p = hscroll_window_tree (window); | 8206 | hscrolled_p = hscroll_window_tree (window); |
| @@ -8265,7 +8265,7 @@ debug_method_add (w, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9) | |||
| 8265 | method[len] = '|'; | 8265 | method[len] = '|'; |
| 8266 | --remaining, ++len; | 8266 | --remaining, ++len; |
| 8267 | } | 8267 | } |
| 8268 | 8268 | ||
| 8269 | strncpy (method + len, buffer, remaining); | 8269 | strncpy (method + len, buffer, remaining); |
| 8270 | 8270 | ||
| 8271 | if (trace_redisplay_p) | 8271 | if (trace_redisplay_p) |
| @@ -8309,7 +8309,7 @@ text_outside_line_unchanged_p (w, start, end) | |||
| 8309 | int start, end; | 8309 | int start, end; |
| 8310 | { | 8310 | { |
| 8311 | int unchanged_p = 1; | 8311 | int unchanged_p = 1; |
| 8312 | 8312 | ||
| 8313 | /* If text or overlays have changed, see where. */ | 8313 | /* If text or overlays have changed, see where. */ |
| 8314 | if (XFASTINT (w->last_modified) < MODIFF | 8314 | if (XFASTINT (w->last_modified) < MODIFF |
| 8315 | || XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF) | 8315 | || XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF) |
| @@ -8323,7 +8323,7 @@ text_outside_line_unchanged_p (w, start, end) | |||
| 8323 | && (BEG_UNCHANGED < start - 1 | 8323 | && (BEG_UNCHANGED < start - 1 |
| 8324 | || END_UNCHANGED < end)) | 8324 | || END_UNCHANGED < end)) |
| 8325 | unchanged_p = 0; | 8325 | unchanged_p = 0; |
| 8326 | 8326 | ||
| 8327 | /* If selective display, can't optimize if changes start at the | 8327 | /* If selective display, can't optimize if changes start at the |
| 8328 | beginning of the line. */ | 8328 | beginning of the line. */ |
| 8329 | if (unchanged_p | 8329 | if (unchanged_p |
| @@ -8389,7 +8389,7 @@ check_point_in_composition (prev_buf, prev_pt, buf, pt) | |||
| 8389 | if (prev_pt == pt) | 8389 | if (prev_pt == pt) |
| 8390 | /* Point didn't move. */ | 8390 | /* Point didn't move. */ |
| 8391 | return 0; | 8391 | return 0; |
| 8392 | 8392 | ||
| 8393 | if (prev_pt > BUF_BEGV (buf) && prev_pt < BUF_ZV (buf) | 8393 | if (prev_pt > BUF_BEGV (buf) && prev_pt < BUF_ZV (buf) |
| 8394 | && find_composition (prev_pt, -1, &start, &end, &prop, buffer) | 8394 | && find_composition (prev_pt, -1, &start, &end, &prop, buffer) |
| 8395 | && COMPOSITION_VALID_P (start, end, prop) | 8395 | && COMPOSITION_VALID_P (start, end, prop) |
| @@ -8471,7 +8471,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8471 | /* Non-zero means redisplay has to consider all windows on all | 8471 | /* Non-zero means redisplay has to consider all windows on all |
| 8472 | frames. Zero means, only selected_window is considered. */ | 8472 | frames. Zero means, only selected_window is considered. */ |
| 8473 | int consider_all_windows_p; | 8473 | int consider_all_windows_p; |
| 8474 | 8474 | ||
| 8475 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); | 8475 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); |
| 8476 | 8476 | ||
| 8477 | /* No redisplay if running in batch mode or frame is not yet fully | 8477 | /* No redisplay if running in batch mode or frame is not yet fully |
| @@ -8506,7 +8506,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8506 | count = BINDING_STACK_SIZE (); | 8506 | count = BINDING_STACK_SIZE (); |
| 8507 | record_unwind_protect (unwind_redisplay, make_number (redisplaying_p)); | 8507 | record_unwind_protect (unwind_redisplay, make_number (redisplaying_p)); |
| 8508 | ++redisplaying_p; | 8508 | ++redisplaying_p; |
| 8509 | 8509 | ||
| 8510 | retry: | 8510 | retry: |
| 8511 | pause = 0; | 8511 | pause = 0; |
| 8512 | reconsider_clip_changes (w, current_buffer); | 8512 | reconsider_clip_changes (w, current_buffer); |
| @@ -8550,7 +8550,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8550 | FOR_EACH_FRAME (tail, frame) | 8550 | FOR_EACH_FRAME (tail, frame) |
| 8551 | { | 8551 | { |
| 8552 | struct frame *f = XFRAME (frame); | 8552 | struct frame *f = XFRAME (frame); |
| 8553 | 8553 | ||
| 8554 | FRAME_SAMPLE_VISIBILITY (f); | 8554 | FRAME_SAMPLE_VISIBILITY (f); |
| 8555 | if (FRAME_VISIBLE_P (f)) | 8555 | if (FRAME_VISIBLE_P (f)) |
| 8556 | ++number_of_visible_frames; | 8556 | ++number_of_visible_frames; |
| @@ -8586,8 +8586,9 @@ redisplay_internal (preserve_echo_area) | |||
| 8586 | && !(PT == XFASTINT (w->last_point) | 8586 | && !(PT == XFASTINT (w->last_point) |
| 8587 | && XFASTINT (w->last_modified) >= MODIFF | 8587 | && XFASTINT (w->last_modified) >= MODIFF |
| 8588 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) | 8588 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) |
| 8589 | && XFASTINT (w->column_number_displayed) != current_column ()) | 8589 | && (XFASTINT (w->column_number_displayed) |
| 8590 | w->update_mode_line = Qt; | 8590 | != (int) current_column ())) /* iftc */ |
| 8591 | w->update_mode_line = Qt; | ||
| 8591 | 8592 | ||
| 8592 | FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1; | 8593 | FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1; |
| 8593 | 8594 | ||
| @@ -8625,7 +8626,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8625 | the echo area. */ | 8626 | the echo area. */ |
| 8626 | if (!display_last_displayed_message_p) | 8627 | if (!display_last_displayed_message_p) |
| 8627 | message_cleared_p = 0; | 8628 | message_cleared_p = 0; |
| 8628 | 8629 | ||
| 8629 | if (fonts_changed_p) | 8630 | if (fonts_changed_p) |
| 8630 | goto retry; | 8631 | goto retry; |
| 8631 | else if (window_height_changed_p) | 8632 | else if (window_height_changed_p) |
| @@ -8633,7 +8634,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8633 | consider_all_windows_p = 1; | 8634 | consider_all_windows_p = 1; |
| 8634 | ++update_mode_lines; | 8635 | ++update_mode_lines; |
| 8635 | ++windows_or_buffers_changed; | 8636 | ++windows_or_buffers_changed; |
| 8636 | 8637 | ||
| 8637 | /* If window configuration was changed, frames may have been | 8638 | /* If window configuration was changed, frames may have been |
| 8638 | marked garbaged. Clear them or we will experience | 8639 | marked garbaged. Clear them or we will experience |
| 8639 | surprises wrt scrolling. */ | 8640 | surprises wrt scrolling. */ |
| @@ -8653,14 +8654,14 @@ redisplay_internal (preserve_echo_area) | |||
| 8653 | consider_all_windows_p = 1; | 8654 | consider_all_windows_p = 1; |
| 8654 | ++windows_or_buffers_changed; | 8655 | ++windows_or_buffers_changed; |
| 8655 | ++update_mode_lines; | 8656 | ++update_mode_lines; |
| 8656 | 8657 | ||
| 8657 | /* If window configuration was changed, frames may have been | 8658 | /* If window configuration was changed, frames may have been |
| 8658 | marked garbaged. Clear them or we will experience | 8659 | marked garbaged. Clear them or we will experience |
| 8659 | surprises wrt scrolling. */ | 8660 | surprises wrt scrolling. */ |
| 8660 | if (frame_garbaged) | 8661 | if (frame_garbaged) |
| 8661 | clear_garbaged_frames (); | 8662 | clear_garbaged_frames (); |
| 8662 | } | 8663 | } |
| 8663 | 8664 | ||
| 8664 | 8665 | ||
| 8665 | /* If showing the region, and mark has changed, we must redisplay | 8666 | /* If showing the region, and mark has changed, we must redisplay |
| 8666 | the whole window. The assignment to this_line_start_pos prevents | 8667 | the whole window. The assignment to this_line_start_pos prevents |
| @@ -8742,7 +8743,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8742 | 8743 | ||
| 8743 | /* If line contains point, is not continued, | 8744 | /* If line contains point, is not continued, |
| 8744 | and ends at same distance from eob as before, we win */ | 8745 | and ends at same distance from eob as before, we win */ |
| 8745 | if (w->cursor.vpos >= 0 | 8746 | if (w->cursor.vpos >= 0 |
| 8746 | /* Line is not continued, otherwise this_line_start_pos | 8747 | /* Line is not continued, otherwise this_line_start_pos |
| 8747 | would have been set to 0 in display_line. */ | 8748 | would have been set to 0 in display_line. */ |
| 8748 | && CHARPOS (this_line_start_pos) | 8749 | && CHARPOS (this_line_start_pos) |
| @@ -8759,7 +8760,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8759 | struct glyph_row *row | 8760 | struct glyph_row *row |
| 8760 | = MATRIX_ROW (w->current_matrix, this_line_vpos + 1); | 8761 | = MATRIX_ROW (w->current_matrix, this_line_vpos + 1); |
| 8761 | int delta, delta_bytes; | 8762 | int delta, delta_bytes; |
| 8762 | 8763 | ||
| 8763 | if (Z - CHARPOS (tlendpos) == ZV) | 8764 | if (Z - CHARPOS (tlendpos) == ZV) |
| 8764 | { | 8765 | { |
| 8765 | /* This line ends at end of (accessible part of) | 8766 | /* This line ends at end of (accessible part of) |
| @@ -8783,7 +8784,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8783 | - BYTEPOS (tlendpos) | 8784 | - BYTEPOS (tlendpos) |
| 8784 | - MATRIX_ROW_START_BYTEPOS (row)); | 8785 | - MATRIX_ROW_START_BYTEPOS (row)); |
| 8785 | } | 8786 | } |
| 8786 | 8787 | ||
| 8787 | increment_matrix_positions (w->current_matrix, | 8788 | increment_matrix_positions (w->current_matrix, |
| 8788 | this_line_vpos + 1, | 8789 | this_line_vpos + 1, |
| 8789 | w->current_matrix->nrows, | 8790 | w->current_matrix->nrows, |
| @@ -8802,7 +8803,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8802 | && this_line_vpos > 0) | 8803 | && this_line_vpos > 0) |
| 8803 | XSETINT (w->window_end_vpos, this_line_vpos - 1); | 8804 | XSETINT (w->window_end_vpos, this_line_vpos - 1); |
| 8804 | w->window_end_valid = Qnil; | 8805 | w->window_end_valid = Qnil; |
| 8805 | 8806 | ||
| 8806 | /* Update hint: No need to try to scroll in update_window. */ | 8807 | /* Update hint: No need to try to scroll in update_window. */ |
| 8807 | w->desired_matrix->no_scrolling_p = 1; | 8808 | w->desired_matrix->no_scrolling_p = 1; |
| 8808 | 8809 | ||
| @@ -8826,7 +8827,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8826 | { | 8827 | { |
| 8827 | do_pending_window_change (1); | 8828 | do_pending_window_change (1); |
| 8828 | 8829 | ||
| 8829 | /* We used to always goto end_of_redisplay here, but this | 8830 | /* We used to always goto end_of_redisplay here, but this |
| 8830 | isn't enough if we have a blinking cursor. */ | 8831 | isn't enough if we have a blinking cursor. */ |
| 8831 | if (w->cursor_off_p == w->last_cursor_off_p) | 8832 | if (w->cursor_off_p == w->last_cursor_off_p) |
| 8832 | goto end_of_redisplay; | 8833 | goto end_of_redisplay; |
| @@ -8854,7 +8855,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8854 | it.current_x = this_line_start_x; | 8855 | it.current_x = this_line_start_x; |
| 8855 | it.current_y = this_line_y; | 8856 | it.current_y = this_line_y; |
| 8856 | it.vpos = this_line_vpos; | 8857 | it.vpos = this_line_vpos; |
| 8857 | 8858 | ||
| 8858 | /* The call to move_it_to stops in front of PT, but | 8859 | /* The call to move_it_to stops in front of PT, but |
| 8859 | moves over before-strings. */ | 8860 | moves over before-strings. */ |
| 8860 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | 8861 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
| @@ -8885,7 +8886,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8885 | consider_all_windows_p |= buffer_shared > 1; | 8886 | consider_all_windows_p |= buffer_shared > 1; |
| 8886 | ++clear_face_cache_count; | 8887 | ++clear_face_cache_count; |
| 8887 | 8888 | ||
| 8888 | 8889 | ||
| 8889 | /* Build desired matrices, and update the display. If | 8890 | /* Build desired matrices, and update the display. If |
| 8890 | consider_all_windows_p is non-zero, do it for all windows on all | 8891 | consider_all_windows_p is non-zero, do it for all windows on all |
| 8891 | frames. Otherwise do it for selected_window, only. */ | 8892 | frames. Otherwise do it for selected_window, only. */ |
| @@ -8911,7 +8912,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8911 | FOR_EACH_FRAME (tail, frame) | 8912 | FOR_EACH_FRAME (tail, frame) |
| 8912 | { | 8913 | { |
| 8913 | struct frame *f = XFRAME (frame); | 8914 | struct frame *f = XFRAME (frame); |
| 8914 | 8915 | ||
| 8915 | if (FRAME_WINDOW_P (f) || f == sf) | 8916 | if (FRAME_WINDOW_P (f) || f == sf) |
| 8916 | { | 8917 | { |
| 8917 | #ifdef HAVE_WINDOW_SYSTEM | 8918 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -8936,7 +8937,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8936 | /* If fonts changed, display again. */ | 8937 | /* If fonts changed, display again. */ |
| 8937 | if (fonts_changed_p) | 8938 | if (fonts_changed_p) |
| 8938 | goto retry; | 8939 | goto retry; |
| 8939 | 8940 | ||
| 8940 | if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) | 8941 | if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) |
| 8941 | { | 8942 | { |
| 8942 | /* See if we have to hscroll. */ | 8943 | /* See if we have to hscroll. */ |
| @@ -8964,7 +8965,7 @@ redisplay_internal (preserve_echo_area) | |||
| 8964 | bcopy (updated, p, nbytes); | 8965 | bcopy (updated, p, nbytes); |
| 8965 | size *= 2; | 8966 | size *= 2; |
| 8966 | } | 8967 | } |
| 8967 | 8968 | ||
| 8968 | updated[n++] = f; | 8969 | updated[n++] = f; |
| 8969 | } | 8970 | } |
| 8970 | } | 8971 | } |
| @@ -8992,10 +8993,10 @@ redisplay_internal (preserve_echo_area) | |||
| 8992 | internal_condition_case_1 (redisplay_window_1, selected_window, | 8993 | internal_condition_case_1 (redisplay_window_1, selected_window, |
| 8993 | list_of_error, | 8994 | list_of_error, |
| 8994 | redisplay_window_error); | 8995 | redisplay_window_error); |
| 8995 | 8996 | ||
| 8996 | /* Compare desired and current matrices, perform output. */ | 8997 | /* Compare desired and current matrices, perform output. */ |
| 8997 | update: | 8998 | update: |
| 8998 | 8999 | ||
| 8999 | /* If fonts changed, display again. */ | 9000 | /* If fonts changed, display again. */ |
| 9000 | if (fonts_changed_p) | 9001 | if (fonts_changed_p) |
| 9001 | goto retry; | 9002 | goto retry; |
| @@ -9011,7 +9012,7 @@ redisplay_internal (preserve_echo_area) | |||
| 9011 | { | 9012 | { |
| 9012 | if (hscroll_windows (selected_window)) | 9013 | if (hscroll_windows (selected_window)) |
| 9013 | goto retry; | 9014 | goto retry; |
| 9014 | 9015 | ||
| 9015 | XWINDOW (selected_window)->must_be_updated_p = 1; | 9016 | XWINDOW (selected_window)->must_be_updated_p = 1; |
| 9016 | pause = update_frame (sf, 0, 0); | 9017 | pause = update_frame (sf, 0, 0); |
| 9017 | } | 9018 | } |
| @@ -9023,7 +9024,7 @@ redisplay_internal (preserve_echo_area) | |||
| 9023 | it here. */ | 9024 | it here. */ |
| 9024 | mini_window = FRAME_MINIBUF_WINDOW (sf); | 9025 | mini_window = FRAME_MINIBUF_WINDOW (sf); |
| 9025 | mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); | 9026 | mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); |
| 9026 | 9027 | ||
| 9027 | if (mini_frame != sf && FRAME_WINDOW_P (mini_frame)) | 9028 | if (mini_frame != sf && FRAME_WINDOW_P (mini_frame)) |
| 9028 | { | 9029 | { |
| 9029 | XWINDOW (mini_window)->must_be_updated_p = 1; | 9030 | XWINDOW (mini_window)->must_be_updated_p = 1; |
| @@ -9048,7 +9049,7 @@ redisplay_internal (preserve_echo_area) | |||
| 9048 | last_arrow_position = Qt; | 9049 | last_arrow_position = Qt; |
| 9049 | last_arrow_string = Qt; | 9050 | last_arrow_string = Qt; |
| 9050 | } | 9051 | } |
| 9051 | 9052 | ||
| 9052 | /* If we pause after scrolling, some rows in the current | 9053 | /* If we pause after scrolling, some rows in the current |
| 9053 | matrices of some windows are not valid. */ | 9054 | matrices of some windows are not valid. */ |
| 9054 | if (!WINDOW_FULL_WIDTH_P (w) | 9055 | if (!WINDOW_FULL_WIDTH_P (w) |
| @@ -9062,10 +9063,10 @@ redisplay_internal (preserve_echo_area) | |||
| 9062 | /* This has already been done above if | 9063 | /* This has already been done above if |
| 9063 | consider_all_windows_p is set. */ | 9064 | consider_all_windows_p is set. */ |
| 9064 | mark_window_display_accurate_1 (w, 1); | 9065 | mark_window_display_accurate_1 (w, 1); |
| 9065 | 9066 | ||
| 9066 | last_arrow_position = COERCE_MARKER (Voverlay_arrow_position); | 9067 | last_arrow_position = COERCE_MARKER (Voverlay_arrow_position); |
| 9067 | last_arrow_string = Voverlay_arrow_string; | 9068 | last_arrow_string = Voverlay_arrow_string; |
| 9068 | 9069 | ||
| 9069 | if (frame_up_to_date_hook != 0) | 9070 | if (frame_up_to_date_hook != 0) |
| 9070 | frame_up_to_date_hook (sf); | 9071 | frame_up_to_date_hook (sf); |
| 9071 | } | 9072 | } |
| @@ -9182,7 +9183,7 @@ mark_window_display_accurate_1 (w, accurate_p) | |||
| 9182 | if (BUFFERP (w->buffer)) | 9183 | if (BUFFERP (w->buffer)) |
| 9183 | { | 9184 | { |
| 9184 | struct buffer *b = XBUFFER (w->buffer); | 9185 | struct buffer *b = XBUFFER (w->buffer); |
| 9185 | 9186 | ||
| 9186 | w->last_modified | 9187 | w->last_modified |
| 9187 | = make_number (accurate_p ? BUF_MODIFF (b) : 0); | 9188 | = make_number (accurate_p ? BUF_MODIFF (b) : 0); |
| 9188 | w->last_overlay_modified | 9189 | w->last_overlay_modified |
| @@ -9199,14 +9200,14 @@ mark_window_display_accurate_1 (w, accurate_p) | |||
| 9199 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); | 9200 | BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); |
| 9200 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); | 9201 | BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); |
| 9201 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); | 9202 | BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); |
| 9202 | 9203 | ||
| 9203 | w->current_matrix->buffer = b; | 9204 | w->current_matrix->buffer = b; |
| 9204 | w->current_matrix->begv = BUF_BEGV (b); | 9205 | w->current_matrix->begv = BUF_BEGV (b); |
| 9205 | w->current_matrix->zv = BUF_ZV (b); | 9206 | w->current_matrix->zv = BUF_ZV (b); |
| 9206 | 9207 | ||
| 9207 | w->last_cursor = w->cursor; | 9208 | w->last_cursor = w->cursor; |
| 9208 | w->last_cursor_off_p = w->cursor_off_p; | 9209 | w->last_cursor_off_p = w->cursor_off_p; |
| 9209 | 9210 | ||
| 9210 | if (w == XWINDOW (selected_window)) | 9211 | if (w == XWINDOW (selected_window)) |
| 9211 | w->last_point = make_number (BUF_PT (b)); | 9212 | w->last_point = make_number (BUF_PT (b)); |
| 9212 | else | 9213 | else |
| @@ -9238,7 +9239,7 @@ mark_window_display_accurate (window, accurate_p) | |||
| 9238 | int accurate_p; | 9239 | int accurate_p; |
| 9239 | { | 9240 | { |
| 9240 | struct window *w; | 9241 | struct window *w; |
| 9241 | 9242 | ||
| 9242 | for (; !NILP (window); window = w->next) | 9243 | for (; !NILP (window); window = w->next) |
| 9243 | { | 9244 | { |
| 9244 | w = XWINDOW (window); | 9245 | w = XWINDOW (window); |
| @@ -9281,13 +9282,13 @@ disp_char_vector (dp, c) | |||
| 9281 | 9282 | ||
| 9282 | if (SINGLE_BYTE_CHAR_P (c)) | 9283 | if (SINGLE_BYTE_CHAR_P (c)) |
| 9283 | return (dp->contents[c]); | 9284 | return (dp->contents[c]); |
| 9284 | 9285 | ||
| 9285 | SPLIT_CHAR (c, code[0], code[1], code[2]); | 9286 | SPLIT_CHAR (c, code[0], code[1], code[2]); |
| 9286 | if (code[1] < 32) | 9287 | if (code[1] < 32) |
| 9287 | code[1] = -1; | 9288 | code[1] = -1; |
| 9288 | else if (code[2] < 32) | 9289 | else if (code[2] < 32) |
| 9289 | code[2] = -1; | 9290 | code[2] = -1; |
| 9290 | 9291 | ||
| 9291 | /* Here, the possible range of code[0] (== charset ID) is | 9292 | /* Here, the possible range of code[0] (== charset ID) is |
| 9292 | 128..max_charset. Since the top level char table contains data | 9293 | 128..max_charset. Since the top level char table contains data |
| 9293 | for multibyte characters after 256th element, we must increment | 9294 | for multibyte characters after 256th element, we must increment |
| @@ -9301,7 +9302,7 @@ disp_char_vector (dp, c) | |||
| 9301 | if (!SUB_CHAR_TABLE_P (val)) | 9302 | if (!SUB_CHAR_TABLE_P (val)) |
| 9302 | return (NILP (val) ? dp->defalt : val); | 9303 | return (NILP (val) ? dp->defalt : val); |
| 9303 | } | 9304 | } |
| 9304 | 9305 | ||
| 9305 | /* Here, val is a sub char table. We return the default value of | 9306 | /* Here, val is a sub char table. We return the default value of |
| 9306 | it. */ | 9307 | it. */ |
| 9307 | return (dp->defalt); | 9308 | return (dp->defalt); |
| @@ -9322,7 +9323,7 @@ redisplay_windows (window) | |||
| 9322 | while (!NILP (window)) | 9323 | while (!NILP (window)) |
| 9323 | { | 9324 | { |
| 9324 | struct window *w = XWINDOW (window); | 9325 | struct window *w = XWINDOW (window); |
| 9325 | 9326 | ||
| 9326 | if (!NILP (w->hchild)) | 9327 | if (!NILP (w->hchild)) |
| 9327 | redisplay_windows (w->hchild); | 9328 | redisplay_windows (w->hchild); |
| 9328 | else if (!NILP (w->vchild)) | 9329 | else if (!NILP (w->vchild)) |
| @@ -9332,7 +9333,7 @@ redisplay_windows (window) | |||
| 9332 | displayed_buffer = XBUFFER (w->buffer); | 9333 | displayed_buffer = XBUFFER (w->buffer); |
| 9333 | /* Use list_of_error, not Qerror, so that | 9334 | /* Use list_of_error, not Qerror, so that |
| 9334 | we catch only errors and don't run the debugger. */ | 9335 | we catch only errors and don't run the debugger. */ |
| 9335 | internal_condition_case_1 (redisplay_window_0, window, | 9336 | internal_condition_case_1 (redisplay_window_0, window, |
| 9336 | list_of_error, | 9337 | list_of_error, |
| 9337 | redisplay_window_error); | 9338 | redisplay_window_error); |
| 9338 | } | 9339 | } |
| @@ -9415,17 +9416,17 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 9415 | && row->x == 0) | 9416 | && row->x == 0) |
| 9416 | { | 9417 | { |
| 9417 | this_line_buffer = XBUFFER (w->buffer); | 9418 | this_line_buffer = XBUFFER (w->buffer); |
| 9418 | 9419 | ||
| 9419 | CHARPOS (this_line_start_pos) | 9420 | CHARPOS (this_line_start_pos) |
| 9420 | = MATRIX_ROW_START_CHARPOS (row) + delta; | 9421 | = MATRIX_ROW_START_CHARPOS (row) + delta; |
| 9421 | BYTEPOS (this_line_start_pos) | 9422 | BYTEPOS (this_line_start_pos) |
| 9422 | = MATRIX_ROW_START_BYTEPOS (row) + delta_bytes; | 9423 | = MATRIX_ROW_START_BYTEPOS (row) + delta_bytes; |
| 9423 | 9424 | ||
| 9424 | CHARPOS (this_line_end_pos) | 9425 | CHARPOS (this_line_end_pos) |
| 9425 | = Z - (MATRIX_ROW_END_CHARPOS (row) + delta); | 9426 | = Z - (MATRIX_ROW_END_CHARPOS (row) + delta); |
| 9426 | BYTEPOS (this_line_end_pos) | 9427 | BYTEPOS (this_line_end_pos) |
| 9427 | = Z_BYTE - (MATRIX_ROW_END_BYTEPOS (row) + delta_bytes); | 9428 | = Z_BYTE - (MATRIX_ROW_END_BYTEPOS (row) + delta_bytes); |
| 9428 | 9429 | ||
| 9429 | this_line_y = w->cursor.y; | 9430 | this_line_y = w->cursor.y; |
| 9430 | this_line_pixel_height = row->height; | 9431 | this_line_pixel_height = row->height; |
| 9431 | this_line_vpos = w->cursor.vpos; | 9432 | this_line_vpos = w->cursor.vpos; |
| @@ -9455,7 +9456,7 @@ run_window_scroll_functions (window, startp) | |||
| 9455 | 9456 | ||
| 9456 | if (!NILP (Vwindow_scroll_functions)) | 9457 | if (!NILP (Vwindow_scroll_functions)) |
| 9457 | { | 9458 | { |
| 9458 | run_hook_with_args_2 (Qwindow_scroll_functions, window, | 9459 | run_hook_with_args_2 (Qwindow_scroll_functions, window, |
| 9459 | make_number (CHARPOS (startp))); | 9460 | make_number (CHARPOS (startp))); |
| 9460 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | 9461 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 9461 | /* In case the hook functions switch buffers. */ | 9462 | /* In case the hook functions switch buffers. */ |
| @@ -9479,12 +9480,12 @@ make_cursor_line_fully_visible (w) | |||
| 9479 | struct glyph_matrix *matrix; | 9480 | struct glyph_matrix *matrix; |
| 9480 | struct glyph_row *row; | 9481 | struct glyph_row *row; |
| 9481 | int window_height; | 9482 | int window_height; |
| 9482 | 9483 | ||
| 9483 | /* It's not always possible to find the cursor, e.g, when a window | 9484 | /* It's not always possible to find the cursor, e.g, when a window |
| 9484 | is full of overlay strings. Don't do anything in that case. */ | 9485 | is full of overlay strings. Don't do anything in that case. */ |
| 9485 | if (w->cursor.vpos < 0) | 9486 | if (w->cursor.vpos < 0) |
| 9486 | return 1; | 9487 | return 1; |
| 9487 | 9488 | ||
| 9488 | matrix = w->desired_matrix; | 9489 | matrix = w->desired_matrix; |
| 9489 | row = MATRIX_ROW (matrix, w->cursor.vpos); | 9490 | row = MATRIX_ROW (matrix, w->cursor.vpos); |
| 9490 | 9491 | ||
| @@ -9513,7 +9514,7 @@ make_cursor_line_fully_visible (w) | |||
| 9513 | w->cursor.y += dy; | 9514 | w->cursor.y += dy; |
| 9514 | shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy); | 9515 | shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy); |
| 9515 | } | 9516 | } |
| 9516 | 9517 | ||
| 9517 | /* When we change the cursor y-position of the selected window, | 9518 | /* When we change the cursor y-position of the selected window, |
| 9518 | change this_line_y as well so that the display optimization for | 9519 | change this_line_y as well so that the display optimization for |
| 9519 | the cursor line of the selected window in redisplay_internal uses | 9520 | the cursor line of the selected window in redisplay_internal uses |
| @@ -9542,9 +9543,9 @@ make_cursor_line_fully_visible (w) | |||
| 9542 | Value is | 9543 | Value is |
| 9543 | 9544 | ||
| 9544 | 1 if scrolling succeeded | 9545 | 1 if scrolling succeeded |
| 9545 | 9546 | ||
| 9546 | 0 if scrolling didn't find point. | 9547 | 0 if scrolling didn't find point. |
| 9547 | 9548 | ||
| 9548 | -1 if new fonts have been loaded so that we must interrupt | 9549 | -1 if new fonts have been loaded so that we must interrupt |
| 9549 | redisplay, adjust glyph matrices, and try again. */ | 9550 | redisplay, adjust glyph matrices, and try again. */ |
| 9550 | 9551 | ||
| @@ -9583,7 +9584,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9583 | #endif | 9584 | #endif |
| 9584 | 9585 | ||
| 9585 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | 9586 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 9586 | 9587 | ||
| 9587 | /* Compute scroll margin height in pixels. We scroll when point is | 9588 | /* Compute scroll margin height in pixels. We scroll when point is |
| 9588 | within this distance from the top or bottom of the window. */ | 9589 | within this distance from the top or bottom of the window. */ |
| 9589 | if (scroll_margin > 0) | 9590 | if (scroll_margin > 0) |
| @@ -9625,7 +9626,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9625 | if (PT >= CHARPOS (scroll_margin_pos)) | 9626 | if (PT >= CHARPOS (scroll_margin_pos)) |
| 9626 | { | 9627 | { |
| 9627 | int y0; | 9628 | int y0; |
| 9628 | 9629 | ||
| 9629 | /* Point is in the scroll margin at the bottom of the window, or | 9630 | /* Point is in the scroll margin at the bottom of the window, or |
| 9630 | below. Compute a new window start that makes point visible. */ | 9631 | below. Compute a new window start that makes point visible. */ |
| 9631 | 9632 | ||
| @@ -9640,10 +9641,10 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9640 | down so that the line the cursor is in is visible, which | 9641 | down so that the line the cursor is in is visible, which |
| 9641 | means we have to add in the height of the cursor line. */ | 9642 | means we have to add in the height of the cursor line. */ |
| 9642 | dy = line_bottom_y (&it) - y0; | 9643 | dy = line_bottom_y (&it) - y0; |
| 9643 | 9644 | ||
| 9644 | if (dy > scroll_max) | 9645 | if (dy > scroll_max) |
| 9645 | return SCROLLING_FAILED; | 9646 | return SCROLLING_FAILED; |
| 9646 | 9647 | ||
| 9647 | /* Move the window start down. If scrolling conservatively, | 9648 | /* Move the window start down. If scrolling conservatively, |
| 9648 | move it just enough down to make point visible. If | 9649 | move it just enough down to make point visible. If |
| 9649 | scroll_step is set, move it down by scroll_step. */ | 9650 | scroll_step is set, move it down by scroll_step. */ |
| @@ -9687,7 +9688,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9687 | /* Point is in the scroll margin at the top of the window or | 9688 | /* Point is in the scroll margin at the top of the window or |
| 9688 | above what is displayed in the window. */ | 9689 | above what is displayed in the window. */ |
| 9689 | int y0; | 9690 | int y0; |
| 9690 | 9691 | ||
| 9691 | /* Compute the vertical distance from PT to the scroll | 9692 | /* Compute the vertical distance from PT to the scroll |
| 9692 | margin position. Give up if distance is greater than | 9693 | margin position. Give up if distance is greater than |
| 9693 | scroll_max. */ | 9694 | scroll_max. */ |
| @@ -9700,10 +9701,10 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9700 | dy = it.current_y - y0; | 9701 | dy = it.current_y - y0; |
| 9701 | if (dy > scroll_max) | 9702 | if (dy > scroll_max) |
| 9702 | return SCROLLING_FAILED; | 9703 | return SCROLLING_FAILED; |
| 9703 | 9704 | ||
| 9704 | /* Compute new window start. */ | 9705 | /* Compute new window start. */ |
| 9705 | start_display (&it, w, startp); | 9706 | start_display (&it, w, startp); |
| 9706 | 9707 | ||
| 9707 | if (scroll_conservatively) | 9708 | if (scroll_conservatively) |
| 9708 | amount_to_scroll = | 9709 | amount_to_scroll = |
| 9709 | max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); | 9710 | max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); |
| @@ -9720,7 +9721,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9720 | 9721 | ||
| 9721 | if (amount_to_scroll <= 0) | 9722 | if (amount_to_scroll <= 0) |
| 9722 | return SCROLLING_FAILED; | 9723 | return SCROLLING_FAILED; |
| 9723 | 9724 | ||
| 9724 | move_it_vertically (&it, - amount_to_scroll); | 9725 | move_it_vertically (&it, - amount_to_scroll); |
| 9725 | startp = it.current.pos; | 9726 | startp = it.current.pos; |
| 9726 | } | 9727 | } |
| @@ -9741,11 +9742,11 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 9741 | else | 9742 | else |
| 9742 | { | 9743 | { |
| 9743 | /* Maybe forget recorded base line for line number display. */ | 9744 | /* Maybe forget recorded base line for line number display. */ |
| 9744 | if (!just_this_one_p | 9745 | if (!just_this_one_p |
| 9745 | || current_buffer->clip_changed | 9746 | || current_buffer->clip_changed |
| 9746 | || BEG_UNCHANGED < CHARPOS (startp)) | 9747 | || BEG_UNCHANGED < CHARPOS (startp)) |
| 9747 | w->base_line_number = Qnil; | 9748 | w->base_line_number = Qnil; |
| 9748 | 9749 | ||
| 9749 | /* If cursor ends up on a partially visible line, shift display | 9750 | /* If cursor ends up on a partially visible line, shift display |
| 9750 | lines up or down. If that fails because we need larger | 9751 | lines up or down. If that fails because we need larger |
| 9751 | matrices, give up. */ | 9752 | matrices, give up. */ |
| @@ -9777,7 +9778,7 @@ compute_window_start_on_continuation_line (w) | |||
| 9777 | SET_TEXT_POS_FROM_MARKER (start_pos, w->start); | 9778 | SET_TEXT_POS_FROM_MARKER (start_pos, w->start); |
| 9778 | 9779 | ||
| 9779 | /* If window start is on a continuation line... Window start may be | 9780 | /* If window start is on a continuation line... Window start may be |
| 9780 | < BEGV in case there's invisible text at the start of the | 9781 | < BEGV in case there's invisible text at the start of the |
| 9781 | buffer (M-x rmail, for example). */ | 9782 | buffer (M-x rmail, for example). */ |
| 9782 | if (CHARPOS (start_pos) > BEGV | 9783 | if (CHARPOS (start_pos) > BEGV |
| 9783 | && FETCH_BYTE (BYTEPOS (start_pos) - 1) != '\n') | 9784 | && FETCH_BYTE (BYTEPOS (start_pos) - 1) != '\n') |
| @@ -9790,7 +9791,7 @@ compute_window_start_on_continuation_line (w) | |||
| 9790 | SET_TEXT_POS (start_pos, BEGV, BEGV_BYTE); | 9791 | SET_TEXT_POS (start_pos, BEGV, BEGV_BYTE); |
| 9791 | else if (CHARPOS (start_pos) > ZV) | 9792 | else if (CHARPOS (start_pos) > ZV) |
| 9792 | SET_TEXT_POS (start_pos, ZV, ZV_BYTE); | 9793 | SET_TEXT_POS (start_pos, ZV, ZV_BYTE); |
| 9793 | 9794 | ||
| 9794 | /* Find the start of the continued line. This should be fast | 9795 | /* Find the start of the continued line. This should be fast |
| 9795 | because scan_buffer is fast (newline cache). */ | 9796 | because scan_buffer is fast (newline cache). */ |
| 9796 | row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0); | 9797 | row = w->desired_matrix->rows + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0); |
| @@ -9804,7 +9805,7 @@ compute_window_start_on_continuation_line (w) | |||
| 9804 | < XFASTINT (w->height) * XFASTINT (w->width)) | 9805 | < XFASTINT (w->height) * XFASTINT (w->width)) |
| 9805 | { | 9806 | { |
| 9806 | int min_distance, distance; | 9807 | int min_distance, distance; |
| 9807 | 9808 | ||
| 9808 | /* Move forward by display lines to find the new window | 9809 | /* Move forward by display lines to find the new window |
| 9809 | start. If window width was enlarged, the new start can | 9810 | start. If window width was enlarged, the new start can |
| 9810 | be expected to be > the old start. If window width was | 9811 | be expected to be > the old start. If window width was |
| @@ -9820,13 +9821,13 @@ compute_window_start_on_continuation_line (w) | |||
| 9820 | pos = it.current.pos; | 9821 | pos = it.current.pos; |
| 9821 | move_it_by_lines (&it, 1, 0); | 9822 | move_it_by_lines (&it, 1, 0); |
| 9822 | } | 9823 | } |
| 9823 | 9824 | ||
| 9824 | /* Set the window start there. */ | 9825 | /* Set the window start there. */ |
| 9825 | SET_MARKER_FROM_TEXT_POS (w->start, pos); | 9826 | SET_MARKER_FROM_TEXT_POS (w->start, pos); |
| 9826 | window_start_changed_p = 1; | 9827 | window_start_changed_p = 1; |
| 9827 | } | 9828 | } |
| 9828 | } | 9829 | } |
| 9829 | 9830 | ||
| 9830 | return window_start_changed_p; | 9831 | return window_start_changed_p; |
| 9831 | } | 9832 | } |
| 9832 | 9833 | ||
| @@ -9835,7 +9836,7 @@ compute_window_start_on_continuation_line (w) | |||
| 9835 | with window start STARTP. Value is | 9836 | with window start STARTP. Value is |
| 9836 | 9837 | ||
| 9837 | CURSOR_MOVEMENT_SUCCESS if successful | 9838 | CURSOR_MOVEMENT_SUCCESS if successful |
| 9838 | 9839 | ||
| 9839 | CURSOR_MOVEMENT_CANNOT_BE_USED if this method cannot be used | 9840 | CURSOR_MOVEMENT_CANNOT_BE_USED if this method cannot be used |
| 9840 | 9841 | ||
| 9841 | CURSOR_MOVEMENT_MUST_SCROLL if we know we have to scroll the | 9842 | CURSOR_MOVEMENT_MUST_SCROLL if we know we have to scroll the |
| @@ -9846,7 +9847,7 @@ compute_window_start_on_continuation_line (w) | |||
| 9846 | which case we have to abort this redisplay, and adjust matrices | 9847 | which case we have to abort this redisplay, and adjust matrices |
| 9847 | first. */ | 9848 | first. */ |
| 9848 | 9849 | ||
| 9849 | enum | 9850 | enum |
| 9850 | { | 9851 | { |
| 9851 | CURSOR_MOVEMENT_SUCCESS, | 9852 | CURSOR_MOVEMENT_SUCCESS, |
| 9852 | CURSOR_MOVEMENT_CANNOT_BE_USED, | 9853 | CURSOR_MOVEMENT_CANNOT_BE_USED, |
| @@ -9863,7 +9864,7 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 9863 | struct window *w = XWINDOW (window); | 9864 | struct window *w = XWINDOW (window); |
| 9864 | struct frame *f = XFRAME (w->frame); | 9865 | struct frame *f = XFRAME (w->frame); |
| 9865 | int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; | 9866 | int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; |
| 9866 | 9867 | ||
| 9867 | #if GLYPH_DEBUG | 9868 | #if GLYPH_DEBUG |
| 9868 | if (inhibit_try_cursor_movement) | 9869 | if (inhibit_try_cursor_movement) |
| 9869 | return rc; | 9870 | return rc; |
| @@ -9882,7 +9883,7 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 9882 | && !update_mode_lines | 9883 | && !update_mode_lines |
| 9883 | && !windows_or_buffers_changed | 9884 | && !windows_or_buffers_changed |
| 9884 | && !cursor_type_changed | 9885 | && !cursor_type_changed |
| 9885 | /* Can't use this case if highlighting a region. When a | 9886 | /* Can't use this case if highlighting a region. When a |
| 9886 | region exists, cursor movement has to do more than just | 9887 | region exists, cursor movement has to do more than just |
| 9887 | set the cursor. */ | 9888 | set the cursor. */ |
| 9888 | && !(!NILP (Vtransient_mark_mode) | 9889 | && !(!NILP (Vtransient_mark_mode) |
| @@ -9940,7 +9941,7 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 9940 | { | 9941 | { |
| 9941 | int scroll_p = 0; | 9942 | int scroll_p = 0; |
| 9942 | int last_y = window_text_bottom_y (w) - this_scroll_margin; | 9943 | int last_y = window_text_bottom_y (w) - this_scroll_margin; |
| 9943 | 9944 | ||
| 9944 | if (PT > XFASTINT (w->last_point)) | 9945 | if (PT > XFASTINT (w->last_point)) |
| 9945 | { | 9946 | { |
| 9946 | /* Point has moved forward. */ | 9947 | /* Point has moved forward. */ |
| @@ -10008,7 +10009,7 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 10008 | && MATRIX_ROW_END_CHARPOS (row) == PT | 10009 | && MATRIX_ROW_END_CHARPOS (row) == PT |
| 10009 | && !cursor_row_p (w, row)) | 10010 | && !cursor_row_p (w, row)) |
| 10010 | ++row; | 10011 | ++row; |
| 10011 | 10012 | ||
| 10012 | /* If within the scroll margin, scroll. */ | 10013 | /* If within the scroll margin, scroll. */ |
| 10013 | if (row->y < this_scroll_margin | 10014 | if (row->y < this_scroll_margin |
| 10014 | && CHARPOS (startp) != BEGV) | 10015 | && CHARPOS (startp) != BEGV) |
| @@ -10094,8 +10095,8 @@ redisplay_window (window, just_this_one_p) | |||
| 10094 | specbind (Qinhibit_point_motion_hooks, Qt); | 10095 | specbind (Qinhibit_point_motion_hooks, Qt); |
| 10095 | 10096 | ||
| 10096 | reconsider_clip_changes (w, buffer); | 10097 | reconsider_clip_changes (w, buffer); |
| 10097 | 10098 | ||
| 10098 | /* Has the mode line to be updated? */ | 10099 | /* Has the mode line to be updated? */ |
| 10099 | update_mode_line = (!NILP (w->update_mode_line) | 10100 | update_mode_line = (!NILP (w->update_mode_line) |
| 10100 | || update_mode_lines | 10101 | || update_mode_lines |
| 10101 | || buffer->clip_changed); | 10102 | || buffer->clip_changed); |
| @@ -10152,7 +10153,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10152 | window start in case the window's width changed. */ | 10153 | window start in case the window's width changed. */ |
| 10153 | if (XMARKER (w->start)->buffer == current_buffer) | 10154 | if (XMARKER (w->start)->buffer == current_buffer) |
| 10154 | compute_window_start_on_continuation_line (w); | 10155 | compute_window_start_on_continuation_line (w); |
| 10155 | 10156 | ||
| 10156 | w->window_end_valid = Qnil; | 10157 | w->window_end_valid = Qnil; |
| 10157 | } | 10158 | } |
| 10158 | 10159 | ||
| @@ -10170,8 +10171,9 @@ redisplay_window (window, just_this_one_p) | |||
| 10170 | && !(PT == XFASTINT (w->last_point) | 10171 | && !(PT == XFASTINT (w->last_point) |
| 10171 | && XFASTINT (w->last_modified) >= MODIFF | 10172 | && XFASTINT (w->last_modified) >= MODIFF |
| 10172 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) | 10173 | && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) |
| 10173 | && XFASTINT (w->column_number_displayed) != current_column ()) | 10174 | && (XFASTINT (w->column_number_displayed) |
| 10174 | update_mode_line = 1; | 10175 | != (int) current_column ())) /* iftc */ |
| 10176 | update_mode_line = 1; | ||
| 10175 | 10177 | ||
| 10176 | /* Count number of windows showing the selected buffer. An indirect | 10178 | /* Count number of windows showing the selected buffer. An indirect |
| 10177 | buffer counts as its base buffer. */ | 10179 | buffer counts as its base buffer. */ |
| @@ -10206,7 +10208,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10206 | new_pt_byte = ZV_BYTE; | 10208 | new_pt_byte = ZV_BYTE; |
| 10207 | set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE); | 10209 | set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE); |
| 10208 | } | 10210 | } |
| 10209 | 10211 | ||
| 10210 | /* We don't use SET_PT so that the point-motion hooks don't run. */ | 10212 | /* We don't use SET_PT so that the point-motion hooks don't run. */ |
| 10211 | TEMP_SET_PT_BOTH (new_pt, new_pt_byte); | 10213 | TEMP_SET_PT_BOTH (new_pt, new_pt_byte); |
| 10212 | } | 10214 | } |
| @@ -10278,15 +10280,15 @@ redisplay_window (window, just_this_one_p) | |||
| 10278 | w->update_mode_line = Qt; | 10280 | w->update_mode_line = Qt; |
| 10279 | startp = run_window_scroll_functions (window, startp); | 10281 | startp = run_window_scroll_functions (window, startp); |
| 10280 | } | 10282 | } |
| 10281 | 10283 | ||
| 10282 | w->last_modified = make_number (0); | 10284 | w->last_modified = make_number (0); |
| 10283 | w->last_overlay_modified = make_number (0); | 10285 | w->last_overlay_modified = make_number (0); |
| 10284 | if (CHARPOS (startp) < BEGV) | 10286 | if (CHARPOS (startp) < BEGV) |
| 10285 | SET_TEXT_POS (startp, BEGV, BEGV_BYTE); | 10287 | SET_TEXT_POS (startp, BEGV, BEGV_BYTE); |
| 10286 | else if (CHARPOS (startp) > ZV) | 10288 | else if (CHARPOS (startp) > ZV) |
| 10287 | SET_TEXT_POS (startp, ZV, ZV_BYTE); | 10289 | SET_TEXT_POS (startp, ZV, ZV_BYTE); |
| 10288 | 10290 | ||
| 10289 | /* Redisplay, then check if cursor has been set during the | 10291 | /* Redisplay, then check if cursor has been set during the |
| 10290 | redisplay. Give up if new fonts were loaded. */ | 10292 | redisplay. Give up if new fonts were loaded. */ |
| 10291 | if (!try_window (window, startp)) | 10293 | if (!try_window (window, startp)) |
| 10292 | { | 10294 | { |
| @@ -10317,7 +10319,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10317 | SET_TEXT_POS (lpoint, PT, PT_BYTE); | 10319 | SET_TEXT_POS (lpoint, PT, PT_BYTE); |
| 10318 | 10320 | ||
| 10319 | set_cursor_from_row (w, row, w->desired_matrix, 0, 0, 0, 0); | 10321 | set_cursor_from_row (w, row, w->desired_matrix, 0, 0, 0, 0); |
| 10320 | 10322 | ||
| 10321 | /* If we are highlighting the region, then we just changed | 10323 | /* If we are highlighting the region, then we just changed |
| 10322 | the region, so redisplay to show it. */ | 10324 | the region, so redisplay to show it. */ |
| 10323 | if (!NILP (Vtransient_mark_mode) | 10325 | if (!NILP (Vtransient_mark_mode) |
| @@ -10347,13 +10349,13 @@ redisplay_window (window, just_this_one_p) | |||
| 10347 | { | 10349 | { |
| 10348 | case CURSOR_MOVEMENT_SUCCESS: | 10350 | case CURSOR_MOVEMENT_SUCCESS: |
| 10349 | goto done; | 10351 | goto done; |
| 10350 | 10352 | ||
| 10351 | case CURSOR_MOVEMENT_NEED_LARGER_MATRICES: | 10353 | case CURSOR_MOVEMENT_NEED_LARGER_MATRICES: |
| 10352 | goto need_larger_matrices; | 10354 | goto need_larger_matrices; |
| 10353 | 10355 | ||
| 10354 | case CURSOR_MOVEMENT_MUST_SCROLL: | 10356 | case CURSOR_MOVEMENT_MUST_SCROLL: |
| 10355 | goto try_to_scroll; | 10357 | goto try_to_scroll; |
| 10356 | 10358 | ||
| 10357 | default: | 10359 | default: |
| 10358 | abort (); | 10360 | abort (); |
| 10359 | } | 10361 | } |
| @@ -10369,7 +10371,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10369 | #endif | 10371 | #endif |
| 10370 | goto recenter; | 10372 | goto recenter; |
| 10371 | } | 10373 | } |
| 10372 | 10374 | ||
| 10373 | /* Try scrolling with try_window_id. Value is > 0 if update has | 10375 | /* Try scrolling with try_window_id. Value is > 0 if update has |
| 10374 | been done, it is -1 if we know that the same window start will | 10376 | been done, it is -1 if we know that the same window start will |
| 10375 | not work. It is 0 if unsuccessful for some other reason. */ | 10377 | not work. It is 0 if unsuccessful for some other reason. */ |
| @@ -10399,7 +10401,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10399 | #if GLYPH_DEBUG | 10401 | #if GLYPH_DEBUG |
| 10400 | debug_method_add (w, "same window start"); | 10402 | debug_method_add (w, "same window start"); |
| 10401 | #endif | 10403 | #endif |
| 10402 | 10404 | ||
| 10403 | /* Try to redisplay starting at same place as before. | 10405 | /* Try to redisplay starting at same place as before. |
| 10404 | If point has not moved off frame, accept the results. */ | 10406 | If point has not moved off frame, accept the results. */ |
| 10405 | if (!current_matrix_up_to_date_p | 10407 | if (!current_matrix_up_to_date_p |
| @@ -10416,15 +10418,15 @@ redisplay_window (window, just_this_one_p) | |||
| 10416 | 10418 | ||
| 10417 | if (fonts_changed_p) | 10419 | if (fonts_changed_p) |
| 10418 | goto need_larger_matrices; | 10420 | goto need_larger_matrices; |
| 10419 | 10421 | ||
| 10420 | if (w->cursor.vpos >= 0) | 10422 | if (w->cursor.vpos >= 0) |
| 10421 | { | 10423 | { |
| 10422 | if (!just_this_one_p | 10424 | if (!just_this_one_p |
| 10423 | || current_buffer->clip_changed | 10425 | || current_buffer->clip_changed |
| 10424 | || BEG_UNCHANGED < CHARPOS (startp)) | 10426 | || BEG_UNCHANGED < CHARPOS (startp)) |
| 10425 | /* Forget any recorded base line for line number display. */ | 10427 | /* Forget any recorded base line for line number display. */ |
| 10426 | w->base_line_number = Qnil; | 10428 | w->base_line_number = Qnil; |
| 10427 | 10429 | ||
| 10428 | if (!make_cursor_line_fully_visible (w)) | 10430 | if (!make_cursor_line_fully_visible (w)) |
| 10429 | goto need_larger_matrices; | 10431 | goto need_larger_matrices; |
| 10430 | goto done; | 10432 | goto done; |
| @@ -10452,7 +10454,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10452 | || NUMBERP (current_buffer->scroll_up_aggressively) | 10454 | || NUMBERP (current_buffer->scroll_up_aggressively) |
| 10453 | || NUMBERP (current_buffer->scroll_down_aggressively)) | 10455 | || NUMBERP (current_buffer->scroll_down_aggressively)) |
| 10454 | && !current_buffer->clip_changed | 10456 | && !current_buffer->clip_changed |
| 10455 | && CHARPOS (startp) >= BEGV | 10457 | && CHARPOS (startp) >= BEGV |
| 10456 | && CHARPOS (startp) <= ZV) | 10458 | && CHARPOS (startp) <= ZV) |
| 10457 | { | 10459 | { |
| 10458 | /* The function returns -1 if new fonts were loaded, 1 if | 10460 | /* The function returns -1 if new fonts were loaded, 1 if |
| @@ -10465,13 +10467,13 @@ redisplay_window (window, just_this_one_p) | |||
| 10465 | { | 10467 | { |
| 10466 | case SCROLLING_SUCCESS: | 10468 | case SCROLLING_SUCCESS: |
| 10467 | goto done; | 10469 | goto done; |
| 10468 | 10470 | ||
| 10469 | case SCROLLING_NEED_LARGER_MATRICES: | 10471 | case SCROLLING_NEED_LARGER_MATRICES: |
| 10470 | goto need_larger_matrices; | 10472 | goto need_larger_matrices; |
| 10471 | 10473 | ||
| 10472 | case SCROLLING_FAILED: | 10474 | case SCROLLING_FAILED: |
| 10473 | break; | 10475 | break; |
| 10474 | 10476 | ||
| 10475 | default: | 10477 | default: |
| 10476 | abort (); | 10478 | abort (); |
| 10477 | } | 10479 | } |
| @@ -10512,7 +10514,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10512 | } | 10514 | } |
| 10513 | 10515 | ||
| 10514 | it.current_x = it.hpos = 0; | 10516 | it.current_x = it.hpos = 0; |
| 10515 | 10517 | ||
| 10516 | /* Set startp here explicitly in case that helps avoid an infinite loop | 10518 | /* Set startp here explicitly in case that helps avoid an infinite loop |
| 10517 | in case the window-scroll-functions functions get errors. */ | 10519 | in case the window-scroll-functions functions get errors. */ |
| 10518 | set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); | 10520 | set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); |
| @@ -10575,7 +10577,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10575 | ++row; | 10577 | ++row; |
| 10576 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); | 10578 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); |
| 10577 | } | 10579 | } |
| 10578 | 10580 | ||
| 10579 | if (!make_cursor_line_fully_visible (w)) | 10581 | if (!make_cursor_line_fully_visible (w)) |
| 10580 | goto need_larger_matrices; | 10582 | goto need_larger_matrices; |
| 10581 | 10583 | ||
| @@ -10589,17 +10591,18 @@ redisplay_window (window, just_this_one_p) | |||
| 10589 | /* Display the mode line, if we must. */ | 10591 | /* Display the mode line, if we must. */ |
| 10590 | if ((update_mode_line | 10592 | if ((update_mode_line |
| 10591 | /* If window not full width, must redo its mode line | 10593 | /* If window not full width, must redo its mode line |
| 10592 | if (a) the window to its side is being redone and | 10594 | if (a) the window to its side is being redone and |
| 10593 | (b) we do a frame-based redisplay. This is a consequence | 10595 | (b) we do a frame-based redisplay. This is a consequence |
| 10594 | of how inverted lines are drawn in frame-based redisplay. */ | 10596 | of how inverted lines are drawn in frame-based redisplay. */ |
| 10595 | || (!just_this_one_p | 10597 | || (!just_this_one_p |
| 10596 | && !FRAME_WINDOW_P (f) | 10598 | && !FRAME_WINDOW_P (f) |
| 10597 | && !WINDOW_FULL_WIDTH_P (w)) | 10599 | && !WINDOW_FULL_WIDTH_P (w)) |
| 10598 | /* Line number to display. */ | 10600 | /* Line number to display. */ |
| 10599 | || INTEGERP (w->base_line_pos) | 10601 | || INTEGERP (w->base_line_pos) |
| 10600 | /* Column number is displayed and different from the one displayed. */ | 10602 | /* Column number is displayed and different from the one displayed. */ |
| 10601 | || (!NILP (w->column_number_displayed) | 10603 | || (!NILP (w->column_number_displayed) |
| 10602 | && XFASTINT (w->column_number_displayed) != current_column ())) | 10604 | && (XFASTINT (w->column_number_displayed) |
| 10605 | != (int) current_column ()))) /* iftc */ | ||
| 10603 | /* This means that the window has a mode line. */ | 10606 | /* This means that the window has a mode line. */ |
| 10604 | && (WINDOW_WANTS_MODELINE_P (w) | 10607 | && (WINDOW_WANTS_MODELINE_P (w) |
| 10605 | || WINDOW_WANTS_HEADER_LINE_P (w))) | 10608 | || WINDOW_WANTS_HEADER_LINE_P (w))) |
| @@ -10615,7 +10618,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10615 | MATRIX_MODE_LINE_ROW (w->current_matrix)->height | 10618 | MATRIX_MODE_LINE_ROW (w->current_matrix)->height |
| 10616 | = DESIRED_MODE_LINE_HEIGHT (w); | 10619 | = DESIRED_MODE_LINE_HEIGHT (w); |
| 10617 | } | 10620 | } |
| 10618 | 10621 | ||
| 10619 | /* If top line height has changed, arrange for a thorough | 10622 | /* If top line height has changed, arrange for a thorough |
| 10620 | immediate redisplay using the correct mode line height. */ | 10623 | immediate redisplay using the correct mode line height. */ |
| 10621 | if (WINDOW_WANTS_HEADER_LINE_P (w) | 10624 | if (WINDOW_WANTS_HEADER_LINE_P (w) |
| @@ -10638,7 +10641,7 @@ redisplay_window (window, just_this_one_p) | |||
| 10638 | } | 10641 | } |
| 10639 | 10642 | ||
| 10640 | finish_menu_bars: | 10643 | finish_menu_bars: |
| 10641 | 10644 | ||
| 10642 | /* When we reach a frame's selected window, redo the frame's menu bar. */ | 10645 | /* When we reach a frame's selected window, redo the frame's menu bar. */ |
| 10643 | if (update_mode_line | 10646 | if (update_mode_line |
| 10644 | && EQ (FRAME_SELECTED_WINDOW (f), window)) | 10647 | && EQ (FRAME_SELECTED_WINDOW (f), window)) |
| @@ -10692,9 +10695,9 @@ redisplay_window (window, just_this_one_p) | |||
| 10692 | moment, we'll pretend it is. */ | 10695 | moment, we'll pretend it is. */ |
| 10693 | end = (Z - XFASTINT (w->window_end_pos)) - BEGV; | 10696 | end = (Z - XFASTINT (w->window_end_pos)) - BEGV; |
| 10694 | 10697 | ||
| 10695 | if (end < start) | 10698 | if (end < start) |
| 10696 | end = start; | 10699 | end = start; |
| 10697 | if (whole < (end - start)) | 10700 | if (whole < (end - start)) |
| 10698 | whole = end - start; | 10701 | whole = end - start; |
| 10699 | } | 10702 | } |
| 10700 | else | 10703 | else |
| @@ -10775,7 +10778,7 @@ try_window (window, pos) | |||
| 10775 | w->window_end_bytepos = 0; | 10778 | w->window_end_bytepos = 0; |
| 10776 | w->window_end_pos = w->window_end_vpos = make_number (0); | 10779 | w->window_end_pos = w->window_end_vpos = make_number (0); |
| 10777 | } | 10780 | } |
| 10778 | 10781 | ||
| 10779 | /* But that is not valid info until redisplay finishes. */ | 10782 | /* But that is not valid info until redisplay finishes. */ |
| 10780 | w->window_end_valid = Qnil; | 10783 | w->window_end_valid = Qnil; |
| 10781 | return 1; | 10784 | return 1; |
| @@ -10846,11 +10849,11 @@ try_window_reusing_current_matrix (w) | |||
| 10846 | 10849 | ||
| 10847 | /* Clear the desired matrix for the display below. */ | 10850 | /* Clear the desired matrix for the display below. */ |
| 10848 | clear_glyph_matrix (w->desired_matrix); | 10851 | clear_glyph_matrix (w->desired_matrix); |
| 10849 | 10852 | ||
| 10850 | if (CHARPOS (new_start) <= CHARPOS (start)) | 10853 | if (CHARPOS (new_start) <= CHARPOS (start)) |
| 10851 | { | 10854 | { |
| 10852 | int first_row_y; | 10855 | int first_row_y; |
| 10853 | 10856 | ||
| 10854 | /* Don't use this method if the display starts with an ellipsis | 10857 | /* Don't use this method if the display starts with an ellipsis |
| 10855 | displayed for invisible text. It's not easy to handle that case | 10858 | displayed for invisible text. It's not easy to handle that case |
| 10856 | below, and it's certainly not worth the effort since this is | 10859 | below, and it's certainly not worth the effort since this is |
| @@ -10859,7 +10862,7 @@ try_window_reusing_current_matrix (w) | |||
| 10859 | return 0; | 10862 | return 0; |
| 10860 | 10863 | ||
| 10861 | IF_DEBUG (debug_method_add (w, "twu1")); | 10864 | IF_DEBUG (debug_method_add (w, "twu1")); |
| 10862 | 10865 | ||
| 10863 | /* Display up to a row that can be reused. The variable | 10866 | /* Display up to a row that can be reused. The variable |
| 10864 | last_text_row is set to the last row displayed that displays | 10867 | last_text_row is set to the last row displayed that displays |
| 10865 | text. Note that it.vpos == 0 if or if not there is a | 10868 | text. Note that it.vpos == 0 if or if not there is a |
| @@ -10868,7 +10871,7 @@ try_window_reusing_current_matrix (w) | |||
| 10868 | first_row_y = it.current_y; | 10871 | first_row_y = it.current_y; |
| 10869 | w->cursor.vpos = -1; | 10872 | w->cursor.vpos = -1; |
| 10870 | last_text_row = last_reused_text_row = NULL; | 10873 | last_text_row = last_reused_text_row = NULL; |
| 10871 | 10874 | ||
| 10872 | while (it.current_y < it.last_visible_y | 10875 | while (it.current_y < it.last_visible_y |
| 10873 | && IT_CHARPOS (it) < CHARPOS (start) | 10876 | && IT_CHARPOS (it) < CHARPOS (start) |
| 10874 | && !fonts_changed_p) | 10877 | && !fonts_changed_p) |
| @@ -10882,12 +10885,12 @@ try_window_reusing_current_matrix (w) | |||
| 10882 | { | 10885 | { |
| 10883 | /* IT.vpos always starts from 0; it counts text lines. */ | 10886 | /* IT.vpos always starts from 0; it counts text lines. */ |
| 10884 | nrows_scrolled = it.vpos; | 10887 | nrows_scrolled = it.vpos; |
| 10885 | 10888 | ||
| 10886 | /* Find PT if not already found in the lines displayed. */ | 10889 | /* Find PT if not already found in the lines displayed. */ |
| 10887 | if (w->cursor.vpos < 0) | 10890 | if (w->cursor.vpos < 0) |
| 10888 | { | 10891 | { |
| 10889 | int dy = it.current_y - first_row_y; | 10892 | int dy = it.current_y - first_row_y; |
| 10890 | 10893 | ||
| 10891 | row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); | 10894 | row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
| 10892 | row = row_containing_pos (w, PT, row, NULL, dy); | 10895 | row = row_containing_pos (w, PT, row, NULL, dy); |
| 10893 | if (row) | 10896 | if (row) |
| @@ -10926,7 +10929,7 @@ try_window_reusing_current_matrix (w) | |||
| 10926 | start_vpos, | 10929 | start_vpos, |
| 10927 | MATRIX_ROW_VPOS (bottom_row, w->current_matrix), | 10930 | MATRIX_ROW_VPOS (bottom_row, w->current_matrix), |
| 10928 | nrows_scrolled); | 10931 | nrows_scrolled); |
| 10929 | 10932 | ||
| 10930 | /* Disable lines that must be updated. */ | 10933 | /* Disable lines that must be updated. */ |
| 10931 | for (i = 0; i < it.vpos; ++i) | 10934 | for (i = 0; i < it.vpos; ++i) |
| 10932 | (start_row + i)->enabled_p = 0; | 10935 | (start_row + i)->enabled_p = 0; |
| @@ -10945,7 +10948,7 @@ try_window_reusing_current_matrix (w) | |||
| 10945 | row->visible_height -= min_y - row->y; | 10948 | row->visible_height -= min_y - row->y; |
| 10946 | if (row->y + row->height > max_y) | 10949 | if (row->y + row->height > max_y) |
| 10947 | row->visible_height -= row->y + row->height - max_y; | 10950 | row->visible_height -= row->y + row->height - max_y; |
| 10948 | 10951 | ||
| 10949 | it.current_y += row->height; | 10952 | it.current_y += row->height; |
| 10950 | 10953 | ||
| 10951 | if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) | 10954 | if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
| @@ -10953,7 +10956,7 @@ try_window_reusing_current_matrix (w) | |||
| 10953 | if (MATRIX_ROW_BOTTOM_Y (row) >= it.last_visible_y) | 10956 | if (MATRIX_ROW_BOTTOM_Y (row) >= it.last_visible_y) |
| 10954 | break; | 10957 | break; |
| 10955 | } | 10958 | } |
| 10956 | 10959 | ||
| 10957 | /* Disable lines in the current matrix which are now | 10960 | /* Disable lines in the current matrix which are now |
| 10958 | below the window. */ | 10961 | below the window. */ |
| 10959 | for (++row; row < bottom_row; ++row) | 10962 | for (++row; row < bottom_row; ++row) |
| @@ -10993,7 +10996,7 @@ try_window_reusing_current_matrix (w) | |||
| 10993 | 10996 | ||
| 10994 | /* Update hint: don't try scrolling again in update_window. */ | 10997 | /* Update hint: don't try scrolling again in update_window. */ |
| 10995 | w->desired_matrix->no_scrolling_p = 1; | 10998 | w->desired_matrix->no_scrolling_p = 1; |
| 10996 | 10999 | ||
| 10997 | #if GLYPH_DEBUG | 11000 | #if GLYPH_DEBUG |
| 10998 | debug_method_add (w, "try_window_reusing_current_matrix 1"); | 11001 | debug_method_add (w, "try_window_reusing_current_matrix 1"); |
| 10999 | #endif | 11002 | #endif |
| @@ -11080,7 +11083,7 @@ try_window_reusing_current_matrix (w) | |||
| 11080 | run.desired_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); | 11083 | run.desired_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
| 11081 | run.height = it.last_visible_y - run.current_y; | 11084 | run.height = it.last_visible_y - run.current_y; |
| 11082 | dy = run.current_y - run.desired_y; | 11085 | dy = run.current_y - run.desired_y; |
| 11083 | 11086 | ||
| 11084 | if (run.height) | 11087 | if (run.height) |
| 11085 | { | 11088 | { |
| 11086 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 11089 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| @@ -11134,7 +11137,7 @@ try_window_reusing_current_matrix (w) | |||
| 11134 | w->window_end_vpos | 11137 | w->window_end_vpos |
| 11135 | = make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled); | 11138 | = make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled); |
| 11136 | } | 11139 | } |
| 11137 | 11140 | ||
| 11138 | w->window_end_valid = Qnil; | 11141 | w->window_end_valid = Qnil; |
| 11139 | w->desired_matrix->no_scrolling_p = 1; | 11142 | w->desired_matrix->no_scrolling_p = 1; |
| 11140 | 11143 | ||
| @@ -11143,7 +11146,7 @@ try_window_reusing_current_matrix (w) | |||
| 11143 | #endif | 11146 | #endif |
| 11144 | return 1; | 11147 | return 1; |
| 11145 | } | 11148 | } |
| 11146 | 11149 | ||
| 11147 | return 0; | 11150 | return 0; |
| 11148 | } | 11151 | } |
| 11149 | 11152 | ||
| @@ -11187,7 +11190,7 @@ find_last_row_displaying_text (matrix, it, start) | |||
| 11187 | break; | 11190 | break; |
| 11188 | ++row; | 11191 | ++row; |
| 11189 | } | 11192 | } |
| 11190 | 11193 | ||
| 11191 | return row_found; | 11194 | return row_found; |
| 11192 | } | 11195 | } |
| 11193 | 11196 | ||
| @@ -11232,7 +11235,7 @@ find_last_unchanged_at_beg_row (w) | |||
| 11232 | /* Stop if last visible row. */ | 11235 | /* Stop if last visible row. */ |
| 11233 | if (MATRIX_ROW_BOTTOM_Y (row) >= yb) | 11236 | if (MATRIX_ROW_BOTTOM_Y (row) >= yb) |
| 11234 | break; | 11237 | break; |
| 11235 | 11238 | ||
| 11236 | ++row; | 11239 | ++row; |
| 11237 | } | 11240 | } |
| 11238 | 11241 | ||
| @@ -11241,17 +11244,17 @@ find_last_unchanged_at_beg_row (w) | |||
| 11241 | 11244 | ||
| 11242 | 11245 | ||
| 11243 | /* Find the first glyph row in the current matrix of W that is not | 11246 | /* Find the first glyph row in the current matrix of W that is not |
| 11244 | affected by changes at the end of current_buffer since the | 11247 | affected by changes at the end of current_buffer since the |
| 11245 | time W's current matrix was built. | 11248 | time W's current matrix was built. |
| 11246 | 11249 | ||
| 11247 | Return in *DELTA the number of chars by which buffer positions in | 11250 | Return in *DELTA the number of chars by which buffer positions in |
| 11248 | unchanged text at the end of current_buffer must be adjusted. | 11251 | unchanged text at the end of current_buffer must be adjusted. |
| 11249 | 11252 | ||
| 11250 | Return in *DELTA_BYTES the corresponding number of bytes. | 11253 | Return in *DELTA_BYTES the corresponding number of bytes. |
| 11251 | 11254 | ||
| 11252 | Value is null if no such row exists, i.e. all rows are affected by | 11255 | Value is null if no such row exists, i.e. all rows are affected by |
| 11253 | changes. */ | 11256 | changes. */ |
| 11254 | 11257 | ||
| 11255 | static struct glyph_row * | 11258 | static struct glyph_row * |
| 11256 | find_first_unchanged_at_end_row (w, delta, delta_bytes) | 11259 | find_first_unchanged_at_end_row (w, delta, delta_bytes) |
| 11257 | struct window *w; | 11260 | struct window *w; |
| @@ -11266,7 +11269,7 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 11266 | is not up to date. */ | 11269 | is not up to date. */ |
| 11267 | if (NILP (w->window_end_valid)) | 11270 | if (NILP (w->window_end_valid)) |
| 11268 | abort (); | 11271 | abort (); |
| 11269 | 11272 | ||
| 11270 | /* A value of window_end_pos >= END_UNCHANGED means that the window | 11273 | /* A value of window_end_pos >= END_UNCHANGED means that the window |
| 11271 | end is in the range of changed text. If so, there is no | 11274 | end is in the range of changed text. If so, there is no |
| 11272 | unchanged row at the end of W's current matrix. */ | 11275 | unchanged row at the end of W's current matrix. */ |
| @@ -11275,8 +11278,8 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 11275 | 11278 | ||
| 11276 | /* Set row to the last row in W's current matrix displaying text. */ | 11279 | /* Set row to the last row in W's current matrix displaying text. */ |
| 11277 | row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); | 11280 | row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); |
| 11278 | 11281 | ||
| 11279 | /* If matrix is entirely empty, no unchanged row exists. */ | 11282 | /* If matrix is entirely empty, no unchanged row exists. */ |
| 11280 | if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) | 11283 | if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
| 11281 | { | 11284 | { |
| 11282 | /* The value of row is the last glyph row in the matrix having a | 11285 | /* The value of row is the last glyph row in the matrix having a |
| @@ -11301,14 +11304,14 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 11301 | position. */ | 11304 | position. */ |
| 11302 | last_unchanged_pos = Z - END_UNCHANGED + BEG; | 11305 | last_unchanged_pos = Z - END_UNCHANGED + BEG; |
| 11303 | last_unchanged_pos_old = last_unchanged_pos - *delta; | 11306 | last_unchanged_pos_old = last_unchanged_pos - *delta; |
| 11304 | 11307 | ||
| 11305 | /* Search backward from ROW for a row displaying a line that | 11308 | /* Search backward from ROW for a row displaying a line that |
| 11306 | starts at a minimum position >= last_unchanged_pos_old. */ | 11309 | starts at a minimum position >= last_unchanged_pos_old. */ |
| 11307 | for (; row > first_text_row; --row) | 11310 | for (; row > first_text_row; --row) |
| 11308 | { | 11311 | { |
| 11309 | if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row)) | 11312 | if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
| 11310 | abort (); | 11313 | abort (); |
| 11311 | 11314 | ||
| 11312 | if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) | 11315 | if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) |
| 11313 | row_found = row; | 11316 | row_found = row; |
| 11314 | } | 11317 | } |
| @@ -11316,7 +11319,7 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes) | |||
| 11316 | 11319 | ||
| 11317 | if (row_found && !MATRIX_ROW_DISPLAYS_TEXT_P (row_found)) | 11320 | if (row_found && !MATRIX_ROW_DISPLAYS_TEXT_P (row_found)) |
| 11318 | abort (); | 11321 | abort (); |
| 11319 | 11322 | ||
| 11320 | return row_found; | 11323 | return row_found; |
| 11321 | } | 11324 | } |
| 11322 | 11325 | ||
| @@ -11361,7 +11364,7 @@ sync_frame_with_window_matrix_rows (w) | |||
| 11361 | been disabled in try_window_id. */ | 11364 | been disabled in try_window_id. */ |
| 11362 | if (!window_row->enabled_p) | 11365 | if (!window_row->enabled_p) |
| 11363 | frame_row->enabled_p = 0; | 11366 | frame_row->enabled_p = 0; |
| 11364 | 11367 | ||
| 11365 | ++window_row, ++frame_row; | 11368 | ++window_row, ++frame_row; |
| 11366 | } | 11369 | } |
| 11367 | } | 11370 | } |
| @@ -11385,12 +11388,12 @@ row_containing_pos (w, charpos, start, end, dy) | |||
| 11385 | /* If we happen to start on a header-line, skip that. */ | 11388 | /* If we happen to start on a header-line, skip that. */ |
| 11386 | if (row->mode_line_p) | 11389 | if (row->mode_line_p) |
| 11387 | ++row; | 11390 | ++row; |
| 11388 | 11391 | ||
| 11389 | if ((end && row >= end) || !row->enabled_p) | 11392 | if ((end && row >= end) || !row->enabled_p) |
| 11390 | return NULL; | 11393 | return NULL; |
| 11391 | 11394 | ||
| 11392 | last_y = window_text_bottom_y (w) - dy; | 11395 | last_y = window_text_bottom_y (w) - dy; |
| 11393 | 11396 | ||
| 11394 | while ((end == NULL || row < end) | 11397 | while ((end == NULL || row < end) |
| 11395 | && MATRIX_ROW_BOTTOM_Y (row) < last_y | 11398 | && MATRIX_ROW_BOTTOM_Y (row) < last_y |
| 11396 | && (MATRIX_ROW_END_CHARPOS (row) < charpos | 11399 | && (MATRIX_ROW_END_CHARPOS (row) < charpos |
| @@ -11402,7 +11405,7 @@ row_containing_pos (w, charpos, start, end, dy) | |||
| 11402 | && !row->ends_at_zv_p | 11405 | && !row->ends_at_zv_p |
| 11403 | && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))) | 11406 | && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))) |
| 11404 | ++row; | 11407 | ++row; |
| 11405 | 11408 | ||
| 11406 | /* Give up if CHARPOS not found. */ | 11409 | /* Give up if CHARPOS not found. */ |
| 11407 | if ((end && row >= end) | 11410 | if ((end && row >= end) |
| 11408 | || charpos < MATRIX_ROW_START_CHARPOS (row) | 11411 | || charpos < MATRIX_ROW_START_CHARPOS (row) |
| @@ -11484,18 +11487,18 @@ try_window_id (w) | |||
| 11484 | #else | 11487 | #else |
| 11485 | #define GIVE_UP(X) return 0 | 11488 | #define GIVE_UP(X) return 0 |
| 11486 | #endif | 11489 | #endif |
| 11487 | 11490 | ||
| 11488 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 11491 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 11489 | 11492 | ||
| 11490 | /* Don't use this for mini-windows because these can show | 11493 | /* Don't use this for mini-windows because these can show |
| 11491 | messages and mini-buffers, and we don't handle that here. */ | 11494 | messages and mini-buffers, and we don't handle that here. */ |
| 11492 | if (MINI_WINDOW_P (w)) | 11495 | if (MINI_WINDOW_P (w)) |
| 11493 | GIVE_UP (1); | 11496 | GIVE_UP (1); |
| 11494 | 11497 | ||
| 11495 | /* This flag is used to prevent redisplay optimizations. */ | 11498 | /* This flag is used to prevent redisplay optimizations. */ |
| 11496 | if (windows_or_buffers_changed || cursor_type_changed) | 11499 | if (windows_or_buffers_changed || cursor_type_changed) |
| 11497 | GIVE_UP (2); | 11500 | GIVE_UP (2); |
| 11498 | 11501 | ||
| 11499 | /* Verify that narrowing has not changed. This flag is also set to prevent | 11502 | /* Verify that narrowing has not changed. This flag is also set to prevent |
| 11500 | redisplay optimizations. It would be nice to further | 11503 | redisplay optimizations. It would be nice to further |
| 11501 | reduce the number of cases where this prevents try_window_id. */ | 11504 | reduce the number of cases where this prevents try_window_id. */ |
| @@ -11515,15 +11518,15 @@ try_window_id (w) | |||
| 11515 | /* Another way to prevent redisplay optimizations. */ | 11518 | /* Another way to prevent redisplay optimizations. */ |
| 11516 | if (XFASTINT (w->last_modified) == 0) | 11519 | if (XFASTINT (w->last_modified) == 0) |
| 11517 | GIVE_UP (6); | 11520 | GIVE_UP (6); |
| 11518 | 11521 | ||
| 11519 | /* Verify that window is not hscrolled. */ | 11522 | /* Verify that window is not hscrolled. */ |
| 11520 | if (XFASTINT (w->hscroll) != 0) | 11523 | if (XFASTINT (w->hscroll) != 0) |
| 11521 | GIVE_UP (7); | 11524 | GIVE_UP (7); |
| 11522 | 11525 | ||
| 11523 | /* Verify that display wasn't paused. */ | 11526 | /* Verify that display wasn't paused. */ |
| 11524 | if (NILP (w->window_end_valid)) | 11527 | if (NILP (w->window_end_valid)) |
| 11525 | GIVE_UP (8); | 11528 | GIVE_UP (8); |
| 11526 | 11529 | ||
| 11527 | /* Can't use this if highlighting a region because a cursor movement | 11530 | /* Can't use this if highlighting a region because a cursor movement |
| 11528 | will do more than just set the cursor. */ | 11531 | will do more than just set the cursor. */ |
| 11529 | if (!NILP (Vtransient_mark_mode) | 11532 | if (!NILP (Vtransient_mark_mode) |
| @@ -11533,17 +11536,17 @@ try_window_id (w) | |||
| 11533 | /* Likewise if highlighting trailing whitespace. */ | 11536 | /* Likewise if highlighting trailing whitespace. */ |
| 11534 | if (!NILP (Vshow_trailing_whitespace)) | 11537 | if (!NILP (Vshow_trailing_whitespace)) |
| 11535 | GIVE_UP (11); | 11538 | GIVE_UP (11); |
| 11536 | 11539 | ||
| 11537 | /* Likewise if showing a region. */ | 11540 | /* Likewise if showing a region. */ |
| 11538 | if (!NILP (w->region_showing)) | 11541 | if (!NILP (w->region_showing)) |
| 11539 | GIVE_UP (10); | 11542 | GIVE_UP (10); |
| 11540 | 11543 | ||
| 11541 | /* Can use this if overlay arrow position and or string have changed. */ | 11544 | /* Can use this if overlay arrow position and or string have changed. */ |
| 11542 | if (!EQ (last_arrow_position, COERCE_MARKER (Voverlay_arrow_position)) | 11545 | if (!EQ (last_arrow_position, COERCE_MARKER (Voverlay_arrow_position)) |
| 11543 | || !EQ (last_arrow_string, Voverlay_arrow_string)) | 11546 | || !EQ (last_arrow_string, Voverlay_arrow_string)) |
| 11544 | GIVE_UP (12); | 11547 | GIVE_UP (12); |
| 11545 | 11548 | ||
| 11546 | 11549 | ||
| 11547 | /* Make sure beg_unchanged and end_unchanged are up to date. Do it | 11550 | /* Make sure beg_unchanged and end_unchanged are up to date. Do it |
| 11548 | only if buffer has really changed. The reason is that the gap is | 11551 | only if buffer has really changed. The reason is that the gap is |
| 11549 | initially at Z for freshly visited files. The code below would | 11552 | initially at Z for freshly visited files. The code below would |
| @@ -11583,7 +11586,7 @@ try_window_id (w) | |||
| 11583 | Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; | 11586 | Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; |
| 11584 | delta = Z - Z_old; | 11587 | delta = Z - Z_old; |
| 11585 | delta_bytes = Z_BYTE - Z_BYTE_old; | 11588 | delta_bytes = Z_BYTE - Z_BYTE_old; |
| 11586 | 11589 | ||
| 11587 | /* Give up if PT is not in the window. Note that it already has | 11590 | /* Give up if PT is not in the window. Note that it already has |
| 11588 | been checked at the start of try_window_id that PT is not in | 11591 | been checked at the start of try_window_id that PT is not in |
| 11589 | front of the window start. */ | 11592 | front of the window start. */ |
| @@ -11607,7 +11610,7 @@ try_window_id (w) | |||
| 11607 | MATRIX_ROW_VPOS (r1, current_matrix), | 11610 | MATRIX_ROW_VPOS (r1, current_matrix), |
| 11608 | delta, delta_bytes); | 11611 | delta, delta_bytes); |
| 11609 | } | 11612 | } |
| 11610 | 11613 | ||
| 11611 | /* Set the cursor. */ | 11614 | /* Set the cursor. */ |
| 11612 | row = row_containing_pos (w, PT, r0, NULL, 0); | 11615 | row = row_containing_pos (w, PT, r0, NULL, 0); |
| 11613 | set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); | 11616 | set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); |
| @@ -11654,7 +11657,7 @@ try_window_id (w) | |||
| 11654 | } | 11657 | } |
| 11655 | 11658 | ||
| 11656 | /* Give up if window start is in the changed area. | 11659 | /* Give up if window start is in the changed area. |
| 11657 | 11660 | ||
| 11658 | The condition used to read | 11661 | The condition used to read |
| 11659 | 11662 | ||
| 11660 | (BEG_UNCHANGED + END_UNCHANGED != Z - BEG && ...) | 11663 | (BEG_UNCHANGED + END_UNCHANGED != Z - BEG && ...) |
| @@ -11663,7 +11666,7 @@ try_window_id (w) | |||
| 11663 | if (CHARPOS (start) >= first_changed_charpos | 11666 | if (CHARPOS (start) >= first_changed_charpos |
| 11664 | && CHARPOS (start) <= last_changed_charpos) | 11667 | && CHARPOS (start) <= last_changed_charpos) |
| 11665 | GIVE_UP (15); | 11668 | GIVE_UP (15); |
| 11666 | 11669 | ||
| 11667 | /* Check that window start agrees with the start of the first glyph | 11670 | /* Check that window start agrees with the start of the first glyph |
| 11668 | row in its current matrix. Check this after we know the window | 11671 | row in its current matrix. Check this after we know the window |
| 11669 | start is not in changed text, otherwise positions would not be | 11672 | start is not in changed text, otherwise positions would not be |
| @@ -11702,7 +11705,7 @@ try_window_id (w) | |||
| 11702 | if (init_to_row_end (&it, w, last_unchanged_at_beg_row) == 0) | 11705 | if (init_to_row_end (&it, w, last_unchanged_at_beg_row) == 0) |
| 11703 | GIVE_UP (18); | 11706 | GIVE_UP (18); |
| 11704 | start_pos = it.current.pos; | 11707 | start_pos = it.current.pos; |
| 11705 | 11708 | ||
| 11706 | /* Start displaying new lines in the desired matrix at the same | 11709 | /* Start displaying new lines in the desired matrix at the same |
| 11707 | vpos we would use in the current matrix, i.e. below | 11710 | vpos we would use in the current matrix, i.e. below |
| 11708 | last_unchanged_at_beg_row. */ | 11711 | last_unchanged_at_beg_row. */ |
| @@ -11731,7 +11734,7 @@ try_window_id (w) | |||
| 11731 | = find_first_unchanged_at_end_row (w, &delta, &delta_bytes); | 11734 | = find_first_unchanged_at_end_row (w, &delta, &delta_bytes); |
| 11732 | IF_DEBUG (debug_delta = delta); | 11735 | IF_DEBUG (debug_delta = delta); |
| 11733 | IF_DEBUG (debug_delta_bytes = delta_bytes); | 11736 | IF_DEBUG (debug_delta_bytes = delta_bytes); |
| 11734 | 11737 | ||
| 11735 | /* Set stop_pos to the buffer position up to which we will have to | 11738 | /* Set stop_pos to the buffer position up to which we will have to |
| 11736 | display new lines. If first_unchanged_at_end_row != NULL, this | 11739 | display new lines. If first_unchanged_at_end_row != NULL, this |
| 11737 | is the buffer position of the start of the line displayed in that | 11740 | is the buffer position of the start of the line displayed in that |
| @@ -11742,7 +11745,7 @@ try_window_id (w) | |||
| 11742 | { | 11745 | { |
| 11743 | xassert (last_unchanged_at_beg_row == NULL | 11746 | xassert (last_unchanged_at_beg_row == NULL |
| 11744 | || first_unchanged_at_end_row >= last_unchanged_at_beg_row); | 11747 | || first_unchanged_at_end_row >= last_unchanged_at_beg_row); |
| 11745 | 11748 | ||
| 11746 | /* If this is a continuation line, move forward to the next one | 11749 | /* If this is a continuation line, move forward to the next one |
| 11747 | that isn't. Changes in lines above affect this line. | 11750 | that isn't. Changes in lines above affect this line. |
| 11748 | Caution: this may move first_unchanged_at_end_row to a row | 11751 | Caution: this may move first_unchanged_at_end_row to a row |
| @@ -11771,22 +11774,22 @@ try_window_id (w) | |||
| 11771 | 11774 | ||
| 11772 | 11775 | ||
| 11773 | #if GLYPH_DEBUG | 11776 | #if GLYPH_DEBUG |
| 11774 | 11777 | ||
| 11775 | /* Either there is no unchanged row at the end, or the one we have | 11778 | /* Either there is no unchanged row at the end, or the one we have |
| 11776 | now displays text. This is a necessary condition for the window | 11779 | now displays text. This is a necessary condition for the window |
| 11777 | end pos calculation at the end of this function. */ | 11780 | end pos calculation at the end of this function. */ |
| 11778 | xassert (first_unchanged_at_end_row == NULL | 11781 | xassert (first_unchanged_at_end_row == NULL |
| 11779 | || MATRIX_ROW_DISPLAYS_TEXT_P (first_unchanged_at_end_row)); | 11782 | || MATRIX_ROW_DISPLAYS_TEXT_P (first_unchanged_at_end_row)); |
| 11780 | 11783 | ||
| 11781 | debug_last_unchanged_at_beg_vpos | 11784 | debug_last_unchanged_at_beg_vpos |
| 11782 | = (last_unchanged_at_beg_row | 11785 | = (last_unchanged_at_beg_row |
| 11783 | ? MATRIX_ROW_VPOS (last_unchanged_at_beg_row, current_matrix) | 11786 | ? MATRIX_ROW_VPOS (last_unchanged_at_beg_row, current_matrix) |
| 11784 | : -1); | 11787 | : -1); |
| 11785 | debug_first_unchanged_at_end_vpos = first_unchanged_at_end_vpos; | 11788 | debug_first_unchanged_at_end_vpos = first_unchanged_at_end_vpos; |
| 11786 | 11789 | ||
| 11787 | #endif /* GLYPH_DEBUG != 0 */ | 11790 | #endif /* GLYPH_DEBUG != 0 */ |
| 11788 | 11791 | ||
| 11789 | 11792 | ||
| 11790 | /* Display new lines. Set last_text_row to the last new line | 11793 | /* Display new lines. Set last_text_row to the last new line |
| 11791 | displayed which has text on it, i.e. might end up as being the | 11794 | displayed which has text on it, i.e. might end up as being the |
| 11792 | line where the window_end_vpos is. */ | 11795 | line where the window_end_vpos is. */ |
| @@ -11868,17 +11871,17 @@ try_window_id (w) | |||
| 11868 | return -1; | 11871 | return -1; |
| 11869 | } | 11872 | } |
| 11870 | } | 11873 | } |
| 11871 | 11874 | ||
| 11872 | /* Don't let the cursor end in the scroll margins. */ | 11875 | /* Don't let the cursor end in the scroll margins. */ |
| 11873 | { | 11876 | { |
| 11874 | int this_scroll_margin, cursor_height; | 11877 | int this_scroll_margin, cursor_height; |
| 11875 | 11878 | ||
| 11876 | this_scroll_margin = max (0, scroll_margin); | 11879 | this_scroll_margin = max (0, scroll_margin); |
| 11877 | this_scroll_margin = min (this_scroll_margin, | 11880 | this_scroll_margin = min (this_scroll_margin, |
| 11878 | XFASTINT (w->height) / 4); | 11881 | XFASTINT (w->height) / 4); |
| 11879 | this_scroll_margin *= CANON_Y_UNIT (it.f); | 11882 | this_scroll_margin *= CANON_Y_UNIT (it.f); |
| 11880 | cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height; | 11883 | cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height; |
| 11881 | 11884 | ||
| 11882 | if ((w->cursor.y < this_scroll_margin | 11885 | if ((w->cursor.y < this_scroll_margin |
| 11883 | && CHARPOS (start) > BEGV) | 11886 | && CHARPOS (start) > BEGV) |
| 11884 | /* Don't take scroll margin into account at the bottom because | 11887 | /* Don't take scroll margin into account at the bottom because |
| @@ -11897,7 +11900,7 @@ try_window_id (w) | |||
| 11897 | if (dy && run.height) | 11900 | if (dy && run.height) |
| 11898 | { | 11901 | { |
| 11899 | update_begin (f); | 11902 | update_begin (f); |
| 11900 | 11903 | ||
| 11901 | if (FRAME_WINDOW_P (f)) | 11904 | if (FRAME_WINDOW_P (f)) |
| 11902 | { | 11905 | { |
| 11903 | rif->update_window_begin_hook (w); | 11906 | rif->update_window_begin_hook (w); |
| @@ -11915,7 +11918,7 @@ try_window_id (w) | |||
| 11915 | int end = (XFASTINT (w->top) | 11918 | int end = (XFASTINT (w->top) |
| 11916 | + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) | 11919 | + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0) |
| 11917 | + window_internal_height (w)); | 11920 | + window_internal_height (w)); |
| 11918 | 11921 | ||
| 11919 | /* Perform the operation on the screen. */ | 11922 | /* Perform the operation on the screen. */ |
| 11920 | if (dvpos > 0) | 11923 | if (dvpos > 0) |
| 11921 | { | 11924 | { |
| @@ -11949,10 +11952,10 @@ try_window_id (w) | |||
| 11949 | if (!scroll_region_ok) | 11952 | if (!scroll_region_ok) |
| 11950 | ins_del_lines (end + dvpos, -dvpos); | 11953 | ins_del_lines (end + dvpos, -dvpos); |
| 11951 | } | 11954 | } |
| 11952 | 11955 | ||
| 11953 | set_terminal_window (0); | 11956 | set_terminal_window (0); |
| 11954 | } | 11957 | } |
| 11955 | 11958 | ||
| 11956 | update_end (f); | 11959 | update_end (f); |
| 11957 | } | 11960 | } |
| 11958 | 11961 | ||
| @@ -12033,7 +12036,7 @@ try_window_id (w) | |||
| 12033 | get the right continuation_lines_width and current_x. */ | 12036 | get the right continuation_lines_width and current_x. */ |
| 12034 | it.continuation_lines_width = last_row->continuation_lines_width; | 12037 | it.continuation_lines_width = last_row->continuation_lines_width; |
| 12035 | it.hpos = it.current_x = 0; | 12038 | it.hpos = it.current_x = 0; |
| 12036 | 12039 | ||
| 12037 | /* Display the rest of the lines at the window end. */ | 12040 | /* Display the rest of the lines at the window end. */ |
| 12038 | it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos); | 12041 | it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos); |
| 12039 | while (it.current_y < it.last_visible_y | 12042 | while (it.current_y < it.last_visible_y |
| @@ -12062,7 +12065,7 @@ try_window_id (w) | |||
| 12062 | row = find_last_row_displaying_text (w->current_matrix, &it, | 12065 | row = find_last_row_displaying_text (w->current_matrix, &it, |
| 12063 | first_unchanged_at_end_row); | 12066 | first_unchanged_at_end_row); |
| 12064 | xassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); | 12067 | xassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); |
| 12065 | 12068 | ||
| 12066 | w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); | 12069 | w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); |
| 12067 | w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); | 12070 | w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); |
| 12068 | w->window_end_vpos | 12071 | w->window_end_vpos |
| @@ -12263,7 +12266,7 @@ dump_glyph_row (row, vpos, glyphs) | |||
| 12263 | { | 12266 | { |
| 12264 | fprintf (stderr, "Row Start End Used oEI><O\\CTZFesm X Y W H V A P\n"); | 12267 | fprintf (stderr, "Row Start End Used oEI><O\\CTZFesm X Y W H V A P\n"); |
| 12265 | fprintf (stderr, "=======================================================================\n"); | 12268 | fprintf (stderr, "=======================================================================\n"); |
| 12266 | 12269 | ||
| 12267 | fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d\ | 12270 | fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d\ |
| 12268 | %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n", | 12271 | %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n", |
| 12269 | vpos, | 12272 | vpos, |
| @@ -12299,7 +12302,7 @@ dump_glyph_row (row, vpos, glyphs) | |||
| 12299 | fprintf (stderr, "%9d %5d\n", row->start.dpvec_index, | 12302 | fprintf (stderr, "%9d %5d\n", row->start.dpvec_index, |
| 12300 | row->end.dpvec_index); | 12303 | row->end.dpvec_index); |
| 12301 | } | 12304 | } |
| 12302 | 12305 | ||
| 12303 | if (glyphs > 1) | 12306 | if (glyphs > 1) |
| 12304 | { | 12307 | { |
| 12305 | int area; | 12308 | int area; |
| @@ -12308,14 +12311,14 @@ dump_glyph_row (row, vpos, glyphs) | |||
| 12308 | { | 12311 | { |
| 12309 | struct glyph *glyph = row->glyphs[area]; | 12312 | struct glyph *glyph = row->glyphs[area]; |
| 12310 | struct glyph *glyph_end = glyph + row->used[area]; | 12313 | struct glyph *glyph_end = glyph + row->used[area]; |
| 12311 | 12314 | ||
| 12312 | /* Glyph for a line end in text. */ | 12315 | /* Glyph for a line end in text. */ |
| 12313 | if (area == TEXT_AREA && glyph == glyph_end && glyph->charpos > 0) | 12316 | if (area == TEXT_AREA && glyph == glyph_end && glyph->charpos > 0) |
| 12314 | ++glyph_end; | 12317 | ++glyph_end; |
| 12315 | 12318 | ||
| 12316 | if (glyph < glyph_end) | 12319 | if (glyph < glyph_end) |
| 12317 | fprintf (stderr, " Glyph Type Pos O W Code C Face LR\n"); | 12320 | fprintf (stderr, " Glyph Type Pos O W Code C Face LR\n"); |
| 12318 | 12321 | ||
| 12319 | for (; glyph < glyph_end; ++glyph) | 12322 | for (; glyph < glyph_end; ++glyph) |
| 12320 | dump_glyph (row, glyph, area); | 12323 | dump_glyph (row, glyph, area); |
| 12321 | } | 12324 | } |
| @@ -12339,7 +12342,7 @@ dump_glyph_row (row, vpos, glyphs) | |||
| 12339 | else | 12342 | else |
| 12340 | s[i] = '.'; | 12343 | s[i] = '.'; |
| 12341 | } | 12344 | } |
| 12342 | 12345 | ||
| 12343 | s[i] = '\0'; | 12346 | s[i] = '\0'; |
| 12344 | fprintf (stderr, "%3d: (%d) '%s'\n", vpos, row->enabled_p, s); | 12347 | fprintf (stderr, "%3d: (%d) '%s'\n", vpos, row->enabled_p, s); |
| 12345 | } | 12348 | } |
| @@ -12390,7 +12393,7 @@ GLYPH > 1 or omitted means dump glyphs in long form. */) | |||
| 12390 | { | 12393 | { |
| 12391 | struct glyph_matrix *matrix; | 12394 | struct glyph_matrix *matrix; |
| 12392 | int vpos; | 12395 | int vpos; |
| 12393 | 12396 | ||
| 12394 | CHECK_NUMBER (row); | 12397 | CHECK_NUMBER (row); |
| 12395 | matrix = XWINDOW (selected_window)->current_matrix; | 12398 | matrix = XWINDOW (selected_window)->current_matrix; |
| 12396 | vpos = XINT (row); | 12399 | vpos = XINT (row); |
| @@ -12413,7 +12416,7 @@ GLYPH > 1 or omitted means dump glyphs in long form. */) | |||
| 12413 | struct frame *sf = SELECTED_FRAME (); | 12416 | struct frame *sf = SELECTED_FRAME (); |
| 12414 | struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; | 12417 | struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; |
| 12415 | int vpos; | 12418 | int vpos; |
| 12416 | 12419 | ||
| 12417 | CHECK_NUMBER (row); | 12420 | CHECK_NUMBER (row); |
| 12418 | vpos = XINT (row); | 12421 | vpos = XINT (row); |
| 12419 | if (vpos >= 0 && vpos < m->nrows) | 12422 | if (vpos >= 0 && vpos < m->nrows) |
| @@ -12436,7 +12439,7 @@ With ARG, turn tracing on if and only if ARG is positive. */) | |||
| 12436 | arg = Fprefix_numeric_value (arg); | 12439 | arg = Fprefix_numeric_value (arg); |
| 12437 | trace_redisplay_p = XINT (arg) > 0; | 12440 | trace_redisplay_p = XINT (arg) > 0; |
| 12438 | } | 12441 | } |
| 12439 | 12442 | ||
| 12440 | return Qnil; | 12443 | return Qnil; |
| 12441 | } | 12444 | } |
| 12442 | 12445 | ||
| @@ -12451,7 +12454,7 @@ DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", | |||
| 12451 | fprintf (stderr, "%s", SDATA (s)); | 12454 | fprintf (stderr, "%s", SDATA (s)); |
| 12452 | return Qnil; | 12455 | return Qnil; |
| 12453 | } | 12456 | } |
| 12454 | 12457 | ||
| 12455 | #endif /* GLYPH_DEBUG */ | 12458 | #endif /* GLYPH_DEBUG */ |
| 12456 | 12459 | ||
| 12457 | 12460 | ||
| @@ -12488,14 +12491,14 @@ get_overlay_arrow_glyph_row (w) | |||
| 12488 | while (p < arrow_end) | 12491 | while (p < arrow_end) |
| 12489 | { | 12492 | { |
| 12490 | Lisp_Object face, ilisp; | 12493 | Lisp_Object face, ilisp; |
| 12491 | 12494 | ||
| 12492 | /* Get the next character. */ | 12495 | /* Get the next character. */ |
| 12493 | if (multibyte_p) | 12496 | if (multibyte_p) |
| 12494 | it.c = string_char_and_length (p, arrow_len, &it.len); | 12497 | it.c = string_char_and_length (p, arrow_len, &it.len); |
| 12495 | else | 12498 | else |
| 12496 | it.c = *p, it.len = 1; | 12499 | it.c = *p, it.len = 1; |
| 12497 | p += it.len; | 12500 | p += it.len; |
| 12498 | 12501 | ||
| 12499 | /* Get its face. */ | 12502 | /* Get its face. */ |
| 12500 | ilisp = make_number (p - arrow_string); | 12503 | ilisp = make_number (p - arrow_string); |
| 12501 | face = Fget_text_property (ilisp, Qface, Voverlay_arrow_string); | 12504 | face = Fget_text_property (ilisp, Qface, Voverlay_arrow_string); |
| @@ -12514,7 +12517,7 @@ get_overlay_arrow_glyph_row (w) | |||
| 12514 | break; | 12517 | break; |
| 12515 | } | 12518 | } |
| 12516 | } | 12519 | } |
| 12517 | 12520 | ||
| 12518 | set_buffer_temp (old); | 12521 | set_buffer_temp (old); |
| 12519 | return it.glyph_row; | 12522 | return it.glyph_row; |
| 12520 | } | 12523 | } |
| @@ -12544,7 +12547,7 @@ insert_left_trunc_glyphs (it) | |||
| 12544 | CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1; | 12547 | CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1; |
| 12545 | truncate_it.object = make_number (0); | 12548 | truncate_it.object = make_number (0); |
| 12546 | produce_special_glyphs (&truncate_it, IT_TRUNCATION); | 12549 | produce_special_glyphs (&truncate_it, IT_TRUNCATION); |
| 12547 | 12550 | ||
| 12548 | /* Overwrite glyphs from IT with truncation glyphs. */ | 12551 | /* Overwrite glyphs from IT with truncation glyphs. */ |
| 12549 | from = truncate_it.glyph_row->glyphs[TEXT_AREA]; | 12552 | from = truncate_it.glyph_row->glyphs[TEXT_AREA]; |
| 12550 | end = from + truncate_it.glyph_row->used[TEXT_AREA]; | 12553 | end = from + truncate_it.glyph_row->used[TEXT_AREA]; |
| @@ -12607,7 +12610,7 @@ compute_line_metrics (it) | |||
| 12607 | row->phys_ascent = it->max_phys_ascent; | 12610 | row->phys_ascent = it->max_phys_ascent; |
| 12608 | row->phys_height = it->max_phys_ascent + it->max_phys_descent; | 12611 | row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
| 12609 | } | 12612 | } |
| 12610 | 12613 | ||
| 12611 | /* Compute the width of this line. */ | 12614 | /* Compute the width of this line. */ |
| 12612 | row->pixel_width = row->x; | 12615 | row->pixel_width = row->x; |
| 12613 | for (i = 0; i < row->used[TEXT_AREA]; ++i) | 12616 | for (i = 0; i < row->used[TEXT_AREA]; ++i) |
| @@ -12631,7 +12634,7 @@ compute_line_metrics (it) | |||
| 12631 | 12634 | ||
| 12632 | /* Compute how much of the line is visible. */ | 12635 | /* Compute how much of the line is visible. */ |
| 12633 | row->visible_height = row->height; | 12636 | row->visible_height = row->height; |
| 12634 | 12637 | ||
| 12635 | min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (it->w); | 12638 | min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (it->w); |
| 12636 | max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (it->w); | 12639 | max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (it->w); |
| 12637 | 12640 | ||
| @@ -12705,7 +12708,7 @@ append_space (it, default_face_p) | |||
| 12705 | 12708 | ||
| 12706 | saved_object = it->object; | 12709 | saved_object = it->object; |
| 12707 | saved_pos = it->position; | 12710 | saved_pos = it->position; |
| 12708 | 12711 | ||
| 12709 | it->what = IT_CHARACTER; | 12712 | it->what = IT_CHARACTER; |
| 12710 | bzero (&it->position, sizeof it->position); | 12713 | bzero (&it->position, sizeof it->position); |
| 12711 | it->object = make_number (0); | 12714 | it->object = make_number (0); |
| @@ -12720,7 +12723,7 @@ append_space (it, default_face_p) | |||
| 12720 | it->face_id = FACE_FOR_CHAR (it->f, face, 0); | 12723 | it->face_id = FACE_FOR_CHAR (it->f, face, 0); |
| 12721 | 12724 | ||
| 12722 | PRODUCE_GLYPHS (it); | 12725 | PRODUCE_GLYPHS (it); |
| 12723 | 12726 | ||
| 12724 | it->current_x = saved_x; | 12727 | it->current_x = saved_x; |
| 12725 | it->object = saved_object; | 12728 | it->object = saved_object; |
| 12726 | it->position = saved_pos; | 12729 | it->position = saved_pos; |
| @@ -12740,7 +12743,7 @@ append_space (it, default_face_p) | |||
| 12740 | to the end of the display line. Called from display_line. | 12743 | to the end of the display line. Called from display_line. |
| 12741 | If the glyph row is empty, add a space glyph to it so that we | 12744 | If the glyph row is empty, add a space glyph to it so that we |
| 12742 | know the face to draw. Set the glyph row flag fill_line_p. */ | 12745 | know the face to draw. Set the glyph row flag fill_line_p. */ |
| 12743 | 12746 | ||
| 12744 | static void | 12747 | static void |
| 12745 | extend_face_to_end_of_line (it) | 12748 | extend_face_to_end_of_line (it) |
| 12746 | struct it *it; | 12749 | struct it *it; |
| @@ -12751,7 +12754,7 @@ extend_face_to_end_of_line (it) | |||
| 12751 | /* If line is already filled, do nothing. */ | 12754 | /* If line is already filled, do nothing. */ |
| 12752 | if (it->current_x >= it->last_visible_x) | 12755 | if (it->current_x >= it->last_visible_x) |
| 12753 | return; | 12756 | return; |
| 12754 | 12757 | ||
| 12755 | /* Face extension extends the background and box of IT->face_id | 12758 | /* Face extension extends the background and box of IT->face_id |
| 12756 | to the end of the line. If the background equals the background | 12759 | to the end of the line. If the background equals the background |
| 12757 | of the frame, we don't have to do anything. */ | 12760 | of the frame, we don't have to do anything. */ |
| @@ -12759,7 +12762,7 @@ extend_face_to_end_of_line (it) | |||
| 12759 | face = FACE_FROM_ID (it->f, it->saved_face_id); | 12762 | face = FACE_FROM_ID (it->f, it->saved_face_id); |
| 12760 | else | 12763 | else |
| 12761 | face = FACE_FROM_ID (f, it->face_id); | 12764 | face = FACE_FROM_ID (f, it->face_id); |
| 12762 | 12765 | ||
| 12763 | if (FRAME_WINDOW_P (f) | 12766 | if (FRAME_WINDOW_P (f) |
| 12764 | && face->box == FACE_NO_BOX | 12767 | && face->box == FACE_NO_BOX |
| 12765 | && face->background == FRAME_BACKGROUND_PIXEL (f) | 12768 | && face->background == FRAME_BACKGROUND_PIXEL (f) |
| @@ -12801,19 +12804,19 @@ extend_face_to_end_of_line (it) | |||
| 12801 | 12804 | ||
| 12802 | saved_object = it->object; | 12805 | saved_object = it->object; |
| 12803 | saved_pos = it->position; | 12806 | saved_pos = it->position; |
| 12804 | 12807 | ||
| 12805 | it->what = IT_CHARACTER; | 12808 | it->what = IT_CHARACTER; |
| 12806 | bzero (&it->position, sizeof it->position); | 12809 | bzero (&it->position, sizeof it->position); |
| 12807 | it->object = make_number (0); | 12810 | it->object = make_number (0); |
| 12808 | it->c = ' '; | 12811 | it->c = ' '; |
| 12809 | it->len = 1; | 12812 | it->len = 1; |
| 12810 | it->face_id = face->id; | 12813 | it->face_id = face->id; |
| 12811 | 12814 | ||
| 12812 | PRODUCE_GLYPHS (it); | 12815 | PRODUCE_GLYPHS (it); |
| 12813 | 12816 | ||
| 12814 | while (it->current_x <= it->last_visible_x) | 12817 | while (it->current_x <= it->last_visible_x) |
| 12815 | PRODUCE_GLYPHS (it); | 12818 | PRODUCE_GLYPHS (it); |
| 12816 | 12819 | ||
| 12817 | /* Don't count these blanks really. It would let us insert a left | 12820 | /* Don't count these blanks really. It would let us insert a left |
| 12818 | truncation glyph below and make us set the cursor on them, maybe. */ | 12821 | truncation glyph below and make us set the cursor on them, maybe. */ |
| 12819 | it->current_x = saved_x; | 12822 | it->current_x = saved_x; |
| @@ -12857,7 +12860,7 @@ highlight_trailing_whitespace (f, row) | |||
| 12857 | struct glyph_row *row; | 12860 | struct glyph_row *row; |
| 12858 | { | 12861 | { |
| 12859 | int used = row->used[TEXT_AREA]; | 12862 | int used = row->used[TEXT_AREA]; |
| 12860 | 12863 | ||
| 12861 | if (used) | 12864 | if (used) |
| 12862 | { | 12865 | { |
| 12863 | struct glyph *start = row->glyphs[TEXT_AREA]; | 12866 | struct glyph *start = row->glyphs[TEXT_AREA]; |
| @@ -12883,7 +12886,7 @@ highlight_trailing_whitespace (f, row) | |||
| 12883 | && trailing_whitespace_p (glyph->charpos)) | 12886 | && trailing_whitespace_p (glyph->charpos)) |
| 12884 | { | 12887 | { |
| 12885 | int face_id = lookup_named_face (f, Qtrailing_whitespace, 0); | 12888 | int face_id = lookup_named_face (f, Qtrailing_whitespace, 0); |
| 12886 | 12889 | ||
| 12887 | while (glyph >= start | 12890 | while (glyph >= start |
| 12888 | && BUFFERP (glyph->object) | 12891 | && BUFFERP (glyph->object) |
| 12889 | && (glyph->type == STRETCH_GLYPH | 12892 | && (glyph->type == STRETCH_GLYPH |
| @@ -12904,7 +12907,7 @@ cursor_row_p (w, row) | |||
| 12904 | struct glyph_row *row; | 12907 | struct glyph_row *row; |
| 12905 | { | 12908 | { |
| 12906 | int cursor_row_p = 1; | 12909 | int cursor_row_p = 1; |
| 12907 | 12910 | ||
| 12908 | if (PT == MATRIX_ROW_END_CHARPOS (row)) | 12911 | if (PT == MATRIX_ROW_END_CHARPOS (row)) |
| 12909 | { | 12912 | { |
| 12910 | /* If the row ends with a newline from a string, we don't want | 12913 | /* If the row ends with a newline from a string, we don't want |
| @@ -12931,7 +12934,7 @@ cursor_row_p (w, row) | |||
| 12931 | for an overview of struct it. Value is non-zero if | 12934 | for an overview of struct it. Value is non-zero if |
| 12932 | IT->glyph_row displays text, as opposed to a line displaying ZV | 12935 | IT->glyph_row displays text, as opposed to a line displaying ZV |
| 12933 | only. */ | 12936 | only. */ |
| 12934 | 12937 | ||
| 12935 | static int | 12938 | static int |
| 12936 | display_line (it) | 12939 | display_line (it) |
| 12937 | struct it *it; | 12940 | struct it *it; |
| @@ -13006,7 +13009,7 @@ display_line (it) | |||
| 13006 | || (minibuf_level && EQ (it->window, minibuf_window)))) | 13009 | || (minibuf_level && EQ (it->window, minibuf_window)))) |
| 13007 | row->indicate_empty_line_p = 1; | 13010 | row->indicate_empty_line_p = 1; |
| 13008 | } | 13011 | } |
| 13009 | 13012 | ||
| 13010 | it->continuation_lines_width = 0; | 13013 | it->continuation_lines_width = 0; |
| 13011 | row->ends_at_zv_p = 1; | 13014 | row->ends_at_zv_p = 1; |
| 13012 | break; | 13015 | break; |
| @@ -13026,7 +13029,7 @@ display_line (it) | |||
| 13026 | phys_ascent = it->max_phys_ascent; | 13029 | phys_ascent = it->max_phys_ascent; |
| 13027 | phys_descent = it->max_phys_descent; | 13030 | phys_descent = it->max_phys_descent; |
| 13028 | } | 13031 | } |
| 13029 | 13032 | ||
| 13030 | PRODUCE_GLYPHS (it); | 13033 | PRODUCE_GLYPHS (it); |
| 13031 | 13034 | ||
| 13032 | /* If this display element was in marginal areas, continue with | 13035 | /* If this display element was in marginal areas, continue with |
| @@ -13073,7 +13076,7 @@ display_line (it) | |||
| 13073 | { | 13076 | { |
| 13074 | int new_x; | 13077 | int new_x; |
| 13075 | struct glyph *glyph; | 13078 | struct glyph *glyph; |
| 13076 | 13079 | ||
| 13077 | for (i = 0; i < nglyphs; ++i, x = new_x) | 13080 | for (i = 0; i < nglyphs; ++i, x = new_x) |
| 13078 | { | 13081 | { |
| 13079 | glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; | 13082 | glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; |
| @@ -13088,7 +13091,7 @@ display_line (it) | |||
| 13088 | && FRAME_WINDOW_P (it->f)))) | 13091 | && FRAME_WINDOW_P (it->f)))) |
| 13089 | { | 13092 | { |
| 13090 | /* End of a continued line. */ | 13093 | /* End of a continued line. */ |
| 13091 | 13094 | ||
| 13092 | if (it->hpos == 0 | 13095 | if (it->hpos == 0 |
| 13093 | || (new_x == it->last_visible_x | 13096 | || (new_x == it->last_visible_x |
| 13094 | && FRAME_WINDOW_P (it->f))) | 13097 | && FRAME_WINDOW_P (it->f))) |
| @@ -13111,17 +13114,17 @@ display_line (it) | |||
| 13111 | This means the whole character doesn't fit | 13114 | This means the whole character doesn't fit |
| 13112 | on the line. */ | 13115 | on the line. */ |
| 13113 | row->used[TEXT_AREA] = n_glyphs_before; | 13116 | row->used[TEXT_AREA] = n_glyphs_before; |
| 13114 | 13117 | ||
| 13115 | /* Fill the rest of the row with continuation | 13118 | /* Fill the rest of the row with continuation |
| 13116 | glyphs like in 20.x. */ | 13119 | glyphs like in 20.x. */ |
| 13117 | while (row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] | 13120 | while (row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] |
| 13118 | < row->glyphs[1 + TEXT_AREA]) | 13121 | < row->glyphs[1 + TEXT_AREA]) |
| 13119 | produce_special_glyphs (it, IT_CONTINUATION); | 13122 | produce_special_glyphs (it, IT_CONTINUATION); |
| 13120 | 13123 | ||
| 13121 | row->continued_p = 1; | 13124 | row->continued_p = 1; |
| 13122 | it->current_x = x_before; | 13125 | it->current_x = x_before; |
| 13123 | it->continuation_lines_width += x_before; | 13126 | it->continuation_lines_width += x_before; |
| 13124 | 13127 | ||
| 13125 | /* Restore the height to what it was before the | 13128 | /* Restore the height to what it was before the |
| 13126 | element not fitting on the line. */ | 13129 | element not fitting on the line. */ |
| 13127 | it->max_ascent = ascent; | 13130 | it->max_ascent = ascent; |
| @@ -13148,20 +13151,20 @@ display_line (it) | |||
| 13148 | the right edge of the window. Restore | 13151 | the right edge of the window. Restore |
| 13149 | positions to values before the element. */ | 13152 | positions to values before the element. */ |
| 13150 | row->used[TEXT_AREA] = n_glyphs_before + i; | 13153 | row->used[TEXT_AREA] = n_glyphs_before + i; |
| 13151 | 13154 | ||
| 13152 | /* Display continuation glyphs. */ | 13155 | /* Display continuation glyphs. */ |
| 13153 | if (!FRAME_WINDOW_P (it->f)) | 13156 | if (!FRAME_WINDOW_P (it->f)) |
| 13154 | produce_special_glyphs (it, IT_CONTINUATION); | 13157 | produce_special_glyphs (it, IT_CONTINUATION); |
| 13155 | row->continued_p = 1; | 13158 | row->continued_p = 1; |
| 13156 | 13159 | ||
| 13157 | it->continuation_lines_width += x; | 13160 | it->continuation_lines_width += x; |
| 13158 | 13161 | ||
| 13159 | if (nglyphs > 1 && i > 0) | 13162 | if (nglyphs > 1 && i > 0) |
| 13160 | { | 13163 | { |
| 13161 | row->ends_in_middle_of_char_p = 1; | 13164 | row->ends_in_middle_of_char_p = 1; |
| 13162 | it->starts_in_middle_of_char_p = 1; | 13165 | it->starts_in_middle_of_char_p = 1; |
| 13163 | } | 13166 | } |
| 13164 | 13167 | ||
| 13165 | /* Restore the height to what it was before the | 13168 | /* Restore the height to what it was before the |
| 13166 | element not fitting on the line. */ | 13169 | element not fitting on the line. */ |
| 13167 | it->max_ascent = ascent; | 13170 | it->max_ascent = ascent; |
| @@ -13176,7 +13179,7 @@ display_line (it) | |||
| 13176 | { | 13179 | { |
| 13177 | /* Increment number of glyphs actually displayed. */ | 13180 | /* Increment number of glyphs actually displayed. */ |
| 13178 | ++it->hpos; | 13181 | ++it->hpos; |
| 13179 | 13182 | ||
| 13180 | if (x < it->first_visible_x) | 13183 | if (x < it->first_visible_x) |
| 13181 | /* Glyph is partially visible, i.e. row starts at | 13184 | /* Glyph is partially visible, i.e. row starts at |
| 13182 | negative X position. */ | 13185 | negative X position. */ |
| @@ -13191,13 +13194,13 @@ display_line (it) | |||
| 13191 | abort (); | 13194 | abort (); |
| 13192 | } | 13195 | } |
| 13193 | } | 13196 | } |
| 13194 | 13197 | ||
| 13195 | row->ascent = max (row->ascent, it->max_ascent); | 13198 | row->ascent = max (row->ascent, it->max_ascent); |
| 13196 | row->height = max (row->height, it->max_ascent + it->max_descent); | 13199 | row->height = max (row->height, it->max_ascent + it->max_descent); |
| 13197 | row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); | 13200 | row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
| 13198 | row->phys_height = max (row->phys_height, | 13201 | row->phys_height = max (row->phys_height, |
| 13199 | it->max_phys_ascent + it->max_phys_descent); | 13202 | it->max_phys_ascent + it->max_phys_descent); |
| 13200 | 13203 | ||
| 13201 | /* End of this display line if row is continued. */ | 13204 | /* End of this display line if row is continued. */ |
| 13202 | if (row->continued_p) | 13205 | if (row->continued_p) |
| 13203 | break; | 13206 | break; |
| @@ -13215,21 +13218,21 @@ display_line (it) | |||
| 13215 | /* Add a space at the end of the line that is used to | 13218 | /* Add a space at the end of the line that is used to |
| 13216 | display the cursor there. */ | 13219 | display the cursor there. */ |
| 13217 | append_space (it, 0); | 13220 | append_space (it, 0); |
| 13218 | 13221 | ||
| 13219 | /* Extend the face to the end of the line. */ | 13222 | /* Extend the face to the end of the line. */ |
| 13220 | extend_face_to_end_of_line (it); | 13223 | extend_face_to_end_of_line (it); |
| 13221 | 13224 | ||
| 13222 | /* Make sure we have the position. */ | 13225 | /* Make sure we have the position. */ |
| 13223 | if (used_before == 0) | 13226 | if (used_before == 0) |
| 13224 | row->glyphs[TEXT_AREA]->charpos = CHARPOS (it->position); | 13227 | row->glyphs[TEXT_AREA]->charpos = CHARPOS (it->position); |
| 13225 | 13228 | ||
| 13226 | /* Consume the line end. This skips over invisible lines. */ | 13229 | /* Consume the line end. This skips over invisible lines. */ |
| 13227 | set_iterator_to_next (it, 1); | 13230 | set_iterator_to_next (it, 1); |
| 13228 | it->continuation_lines_width = 0; | 13231 | it->continuation_lines_width = 0; |
| 13229 | break; | 13232 | break; |
| 13230 | } | 13233 | } |
| 13231 | 13234 | ||
| 13232 | /* Proceed with next display element. Note that this skips | 13235 | /* Proceed with next display element. Note that this skips |
| 13233 | over lines invisible because of selective display. */ | 13236 | over lines invisible because of selective display. */ |
| 13234 | set_iterator_to_next (it, 1); | 13237 | set_iterator_to_next (it, 1); |
| 13235 | 13238 | ||
| @@ -13244,7 +13247,7 @@ display_line (it) | |||
| 13244 | if (!FRAME_WINDOW_P (it->f)) | 13247 | if (!FRAME_WINDOW_P (it->f)) |
| 13245 | { | 13248 | { |
| 13246 | int i, n; | 13249 | int i, n; |
| 13247 | 13250 | ||
| 13248 | for (i = row->used[TEXT_AREA] - 1; i > 0; --i) | 13251 | for (i = row->used[TEXT_AREA] - 1; i > 0; --i) |
| 13249 | if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i])) | 13252 | if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i])) |
| 13250 | break; | 13253 | break; |
| @@ -13255,7 +13258,7 @@ display_line (it) | |||
| 13255 | produce_special_glyphs (it, IT_TRUNCATION); | 13258 | produce_special_glyphs (it, IT_TRUNCATION); |
| 13256 | } | 13259 | } |
| 13257 | } | 13260 | } |
| 13258 | 13261 | ||
| 13259 | row->truncated_on_right_p = 1; | 13262 | row->truncated_on_right_p = 1; |
| 13260 | it->continuation_lines_width = 0; | 13263 | it->continuation_lines_width = 0; |
| 13261 | reseat_at_next_visible_line_start (it, 0); | 13264 | reseat_at_next_visible_line_start (it, 0); |
| @@ -13312,7 +13315,7 @@ display_line (it) | |||
| 13312 | row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; | 13315 | row->used[TEXT_AREA] = p2 - row->glyphs[TEXT_AREA]; |
| 13313 | } | 13316 | } |
| 13314 | } | 13317 | } |
| 13315 | 13318 | ||
| 13316 | overlay_arrow_seen = 1; | 13319 | overlay_arrow_seen = 1; |
| 13317 | row->overlay_arrow_p = 1; | 13320 | row->overlay_arrow_p = 1; |
| 13318 | } | 13321 | } |
| @@ -13355,7 +13358,7 @@ display_line (it) | |||
| 13355 | 13358 | ||
| 13356 | The menu bar of X frames that don't have X toolkit support is | 13359 | The menu bar of X frames that don't have X toolkit support is |
| 13357 | displayed in a special window W->frame->menu_bar_window. | 13360 | displayed in a special window W->frame->menu_bar_window. |
| 13358 | 13361 | ||
| 13359 | The menu bar of terminal frames is treated specially as far as | 13362 | The menu bar of terminal frames is treated specially as far as |
| 13360 | glyph matrices are concerned. Menu bar lines are not part of | 13363 | glyph matrices are concerned. Menu bar lines are not part of |
| 13361 | windows, so the update is done directly on the frame matrix rows | 13364 | windows, so the update is done directly on the frame matrix rows |
| @@ -13471,11 +13474,11 @@ redisplay_mode_lines (window, force) | |||
| 13471 | int force; | 13474 | int force; |
| 13472 | { | 13475 | { |
| 13473 | int nwindows = 0; | 13476 | int nwindows = 0; |
| 13474 | 13477 | ||
| 13475 | while (!NILP (window)) | 13478 | while (!NILP (window)) |
| 13476 | { | 13479 | { |
| 13477 | struct window *w = XWINDOW (window); | 13480 | struct window *w = XWINDOW (window); |
| 13478 | 13481 | ||
| 13479 | if (WINDOWP (w->hchild)) | 13482 | if (WINDOWP (w->hchild)) |
| 13480 | nwindows += redisplay_mode_lines (w->hchild, force); | 13483 | nwindows += redisplay_mode_lines (w->hchild, force); |
| 13481 | else if (WINDOWP (w->vchild)) | 13484 | else if (WINDOWP (w->vchild)) |
| @@ -13490,13 +13493,13 @@ redisplay_mode_lines (window, force) | |||
| 13490 | /* Set the window's buffer for the mode line display. */ | 13493 | /* Set the window's buffer for the mode line display. */ |
| 13491 | SET_TEXT_POS (lpoint, PT, PT_BYTE); | 13494 | SET_TEXT_POS (lpoint, PT, PT_BYTE); |
| 13492 | set_buffer_internal_1 (XBUFFER (w->buffer)); | 13495 | set_buffer_internal_1 (XBUFFER (w->buffer)); |
| 13493 | 13496 | ||
| 13494 | /* Point refers normally to the selected window. For any | 13497 | /* Point refers normally to the selected window. For any |
| 13495 | other window, set up appropriate value. */ | 13498 | other window, set up appropriate value. */ |
| 13496 | if (!EQ (window, selected_window)) | 13499 | if (!EQ (window, selected_window)) |
| 13497 | { | 13500 | { |
| 13498 | struct text_pos pt; | 13501 | struct text_pos pt; |
| 13499 | 13502 | ||
| 13500 | SET_TEXT_POS_FROM_MARKER (pt, w->pointm); | 13503 | SET_TEXT_POS_FROM_MARKER (pt, w->pointm); |
| 13501 | if (CHARPOS (pt) < BEGV) | 13504 | if (CHARPOS (pt) < BEGV) |
| 13502 | TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); | 13505 | TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); |
| @@ -13540,7 +13543,7 @@ display_mode_lines (w) | |||
| 13540 | selected_frame = w->frame; | 13543 | selected_frame = w->frame; |
| 13541 | old_selected_window = selected_window; | 13544 | old_selected_window = selected_window; |
| 13542 | XSETWINDOW (selected_window, w); | 13545 | XSETWINDOW (selected_window, w); |
| 13543 | 13546 | ||
| 13544 | /* These will be set while the mode line specs are processed. */ | 13547 | /* These will be set while the mode line specs are processed. */ |
| 13545 | line_number_displayed = 0; | 13548 | line_number_displayed = 0; |
| 13546 | w->column_number_displayed = Qnil; | 13549 | w->column_number_displayed = Qnil; |
| @@ -13554,7 +13557,7 @@ display_mode_lines (w) | |||
| 13554 | current_buffer->mode_line_format); | 13557 | current_buffer->mode_line_format); |
| 13555 | ++n; | 13558 | ++n; |
| 13556 | } | 13559 | } |
| 13557 | 13560 | ||
| 13558 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | 13561 | if (WINDOW_WANTS_HEADER_LINE_P (w)) |
| 13559 | { | 13562 | { |
| 13560 | display_mode_line (w, HEADER_LINE_FACE_ID, | 13563 | display_mode_line (w, HEADER_LINE_FACE_ID, |
| @@ -13598,7 +13601,7 @@ display_mode_line (w, face_id, format) | |||
| 13598 | 13601 | ||
| 13599 | /* Fill up with spaces. */ | 13602 | /* Fill up with spaces. */ |
| 13600 | display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); | 13603 | display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); |
| 13601 | 13604 | ||
| 13602 | compute_line_metrics (&it); | 13605 | compute_line_metrics (&it); |
| 13603 | it.glyph_row->full_width_p = 1; | 13606 | it.glyph_row->full_width_p = 1; |
| 13604 | it.glyph_row->mode_line_p = 1; | 13607 | it.glyph_row->mode_line_p = 1; |
| @@ -13640,7 +13643,7 @@ Lisp_Object mode_line_proptrans_alist; | |||
| 13640 | 13643 | ||
| 13641 | PROPS is a property list to add to any string we encounter. | 13644 | PROPS is a property list to add to any string we encounter. |
| 13642 | 13645 | ||
| 13643 | If RISKY is nonzero, remove (disregard) any properties in any string | 13646 | If RISKY is nonzero, remove (disregard) any properties in any string |
| 13644 | we encounter, and ignore :eval and :propertize. */ | 13647 | we encounter, and ignore :eval and :propertize. */ |
| 13645 | 13648 | ||
| 13646 | static int | 13649 | static int |
| @@ -13745,7 +13748,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13745 | /* Advance to end of string or next format specifier. */ | 13748 | /* Advance to end of string or next format specifier. */ |
| 13746 | while ((c = *this++) != '\0' && c != '%') | 13749 | while ((c = *this++) != '\0' && c != '%') |
| 13747 | ; | 13750 | ; |
| 13748 | 13751 | ||
| 13749 | if (this - 1 != last) | 13752 | if (this - 1 != last) |
| 13750 | { | 13753 | { |
| 13751 | /* Output to end of string or up to '%'. Field width | 13754 | /* Output to end of string or up to '%'. Field width |
| @@ -13756,7 +13759,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13756 | prec = chars_in_text (last, this - last); | 13759 | prec = chars_in_text (last, this - last); |
| 13757 | if (precision > 0 && prec > precision - n) | 13760 | if (precision > 0 && prec > precision - n) |
| 13758 | prec = precision - n; | 13761 | prec = precision - n; |
| 13759 | 13762 | ||
| 13760 | if (frame_title_ptr) | 13763 | if (frame_title_ptr) |
| 13761 | n += store_frame_title (last, 0, prec); | 13764 | n += store_frame_title (last, 0, prec); |
| 13762 | else | 13765 | else |
| @@ -13771,7 +13774,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13771 | else /* c == '%' */ | 13774 | else /* c == '%' */ |
| 13772 | { | 13775 | { |
| 13773 | unsigned char *percent_position = this; | 13776 | unsigned char *percent_position = this; |
| 13774 | 13777 | ||
| 13775 | /* Get the specified minimum width. Zero means | 13778 | /* Get the specified minimum width. Zero means |
| 13776 | don't pad. */ | 13779 | don't pad. */ |
| 13777 | field = 0; | 13780 | field = 0; |
| @@ -13784,7 +13787,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13784 | 13787 | ||
| 13785 | /* Note that either PRECISION <= 0 or N < PRECISION. */ | 13788 | /* Note that either PRECISION <= 0 or N < PRECISION. */ |
| 13786 | prec = precision - n; | 13789 | prec = precision - n; |
| 13787 | 13790 | ||
| 13788 | if (c == 'M') | 13791 | if (c == 'M') |
| 13789 | n += display_mode_element (it, depth, field, prec, | 13792 | n += display_mode_element (it, depth, field, prec, |
| 13790 | Vglobal_mode_string, props, | 13793 | Vglobal_mode_string, props, |
| @@ -13794,7 +13797,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13794 | int multibyte; | 13797 | int multibyte; |
| 13795 | int bytepos, charpos; | 13798 | int bytepos, charpos; |
| 13796 | unsigned char *spec; | 13799 | unsigned char *spec; |
| 13797 | 13800 | ||
| 13798 | bytepos = percent_position - lisp_string; | 13801 | bytepos = percent_position - lisp_string; |
| 13799 | charpos = (STRING_MULTIBYTE (elt) | 13802 | charpos = (STRING_MULTIBYTE (elt) |
| 13800 | ? string_byte_to_char (elt, bytepos) | 13803 | ? string_byte_to_char (elt, bytepos) |
| @@ -13808,7 +13811,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13808 | else | 13811 | else |
| 13809 | { | 13812 | { |
| 13810 | int nglyphs_before, nwritten; | 13813 | int nglyphs_before, nwritten; |
| 13811 | 13814 | ||
| 13812 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; | 13815 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; |
| 13813 | nwritten = display_string (spec, Qnil, elt, | 13816 | nwritten = display_string (spec, Qnil, elt, |
| 13814 | charpos, 0, it, | 13817 | charpos, 0, it, |
| @@ -13830,7 +13833,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 13830 | glyph[i].object = elt; | 13833 | glyph[i].object = elt; |
| 13831 | glyph[i].charpos = charpos; | 13834 | glyph[i].charpos = charpos; |
| 13832 | } | 13835 | } |
| 13833 | 13836 | ||
| 13834 | n += nwritten; | 13837 | n += nwritten; |
| 13835 | } | 13838 | } |
| 13836 | } | 13839 | } |
| @@ -14008,7 +14011,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) | |||
| 14008 | n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, | 14011 | n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, |
| 14009 | 0, 0, 0); | 14012 | 0, 0, 0); |
| 14010 | } | 14013 | } |
| 14011 | 14014 | ||
| 14012 | return n; | 14015 | return n; |
| 14013 | } | 14016 | } |
| 14014 | 14017 | ||
| @@ -14023,7 +14026,7 @@ pint2str (buf, width, d) | |||
| 14023 | register int d; | 14026 | register int d; |
| 14024 | { | 14027 | { |
| 14025 | register char *p = buf; | 14028 | register char *p = buf; |
| 14026 | 14029 | ||
| 14027 | if (d <= 0) | 14030 | if (d <= 0) |
| 14028 | *p++ = '0'; | 14031 | *p++ = '0'; |
| 14029 | else | 14032 | else |
| @@ -14034,7 +14037,7 @@ pint2str (buf, width, d) | |||
| 14034 | d /= 10; | 14037 | d /= 10; |
| 14035 | } | 14038 | } |
| 14036 | } | 14039 | } |
| 14037 | 14040 | ||
| 14038 | for (width -= (int) (p - buf); width > 0; --width) | 14041 | for (width -= (int) (p - buf); width > 0; --width) |
| 14039 | *p++ = ' '; | 14042 | *p++ = ' '; |
| 14040 | *p-- = '\0'; | 14043 | *p-- = '\0'; |
| @@ -14100,7 +14103,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) | |||
| 14100 | ? eol_mnemonic_dos : eol_mnemonic_mac)); | 14103 | ? eol_mnemonic_dos : eol_mnemonic_mac)); |
| 14101 | } | 14104 | } |
| 14102 | } | 14105 | } |
| 14103 | 14106 | ||
| 14104 | if (eol_flag) | 14107 | if (eol_flag) |
| 14105 | { | 14108 | { |
| 14106 | /* Mention the EOL conversion if it is not the usual one. */ | 14109 | /* Mention the EOL conversion if it is not the usual one. */ |
| @@ -14176,7 +14179,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14176 | case '%': | 14179 | case '%': |
| 14177 | return "%"; | 14180 | return "%"; |
| 14178 | 14181 | ||
| 14179 | case '[': | 14182 | case '[': |
| 14180 | { | 14183 | { |
| 14181 | int i; | 14184 | int i; |
| 14182 | char *p; | 14185 | char *p; |
| @@ -14190,7 +14193,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14190 | return decode_mode_spec_buf; | 14193 | return decode_mode_spec_buf; |
| 14191 | } | 14194 | } |
| 14192 | 14195 | ||
| 14193 | case ']': | 14196 | case ']': |
| 14194 | { | 14197 | { |
| 14195 | int i; | 14198 | int i; |
| 14196 | char *p; | 14199 | char *p; |
| @@ -14221,13 +14224,13 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14221 | return lots_of_dashes; | 14224 | return lots_of_dashes; |
| 14222 | } | 14225 | } |
| 14223 | 14226 | ||
| 14224 | case 'b': | 14227 | case 'b': |
| 14225 | obj = b->name; | 14228 | obj = b->name; |
| 14226 | break; | 14229 | break; |
| 14227 | 14230 | ||
| 14228 | case 'c': | 14231 | case 'c': |
| 14229 | { | 14232 | { |
| 14230 | int col = current_column (); | 14233 | int col = (int) current_column (); /* iftc */ |
| 14231 | w->column_number_displayed = make_number (col); | 14234 | w->column_number_displayed = make_number (col); |
| 14232 | pint2str (decode_mode_spec_buf, field_width, col); | 14235 | pint2str (decode_mode_spec_buf, field_width, col); |
| 14233 | return decode_mode_spec_buf; | 14236 | return decode_mode_spec_buf; |
| @@ -14241,7 +14244,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14241 | return (char *) SDATA (f->name); | 14244 | return (char *) SDATA (f->name); |
| 14242 | return "Emacs"; | 14245 | return "Emacs"; |
| 14243 | 14246 | ||
| 14244 | case 'f': | 14247 | case 'f': |
| 14245 | obj = b->filename; | 14248 | obj = b->filename; |
| 14246 | break; | 14249 | break; |
| 14247 | 14250 | ||
| @@ -14253,7 +14256,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14253 | int nlines, junk; | 14256 | int nlines, junk; |
| 14254 | int height = XFASTINT (w->height); | 14257 | int height = XFASTINT (w->height); |
| 14255 | 14258 | ||
| 14256 | /* If we decided that this buffer isn't suitable for line numbers, | 14259 | /* If we decided that this buffer isn't suitable for line numbers, |
| 14257 | don't forget that too fast. */ | 14260 | don't forget that too fast. */ |
| 14258 | if (EQ (w->base_line_pos, w->buffer)) | 14261 | if (EQ (w->base_line_pos, w->buffer)) |
| 14259 | goto no_value; | 14262 | goto no_value; |
| @@ -14319,7 +14322,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14319 | limit_byte, | 14322 | limit_byte, |
| 14320 | - (height * 2 + 30), | 14323 | - (height * 2 + 30), |
| 14321 | &position); | 14324 | &position); |
| 14322 | /* If we couldn't find the lines we wanted within | 14325 | /* If we couldn't find the lines we wanted within |
| 14323 | line_number_display_limit_width chars per line, | 14326 | line_number_display_limit_width chars per line, |
| 14324 | give up on line numbers for this window. */ | 14327 | give up on line numbers for this window. */ |
| 14325 | if (position == limit_byte && limit == startpos - distance) | 14328 | if (position == limit_byte && limit == startpos - distance) |
| @@ -14357,7 +14360,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte) | |||
| 14357 | } | 14360 | } |
| 14358 | break; | 14361 | break; |
| 14359 | 14362 | ||
| 14360 | case 'm': | 14363 | case 'm': |
| 14361 | obj = b->mode_name; | 14364 | obj = b->mode_name; |
| 14362 | break; | 14365 | break; |
| 14363 | 14366 | ||
| @@ -14617,7 +14620,7 @@ display_count_lines (start, start_byte, limit_byte, count, byte_pos_ptr) | |||
| 14617 | If STRING has fewer characters than FIELD_WIDTH, pad to the right | 14620 | If STRING has fewer characters than FIELD_WIDTH, pad to the right |
| 14618 | with spaces. If STRING has more characters, more than FIELD_WIDTH | 14621 | with spaces. If STRING has more characters, more than FIELD_WIDTH |
| 14619 | glyphs will be produced. FIELD_WIDTH <= 0 means don't pad. | 14622 | glyphs will be produced. FIELD_WIDTH <= 0 means don't pad. |
| 14620 | 14623 | ||
| 14621 | PRECISION is the maximum number of characters to output from | 14624 | PRECISION is the maximum number of characters to output from |
| 14622 | STRING. PRECISION < 0 means don't truncate the string. | 14625 | STRING. PRECISION < 0 means don't truncate the string. |
| 14623 | 14626 | ||
| @@ -14663,7 +14666,7 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 14663 | { | 14666 | { |
| 14664 | int endptr; | 14667 | int endptr; |
| 14665 | struct face *face; | 14668 | struct face *face; |
| 14666 | 14669 | ||
| 14667 | it->face_id | 14670 | it->face_id |
| 14668 | = face_at_string_position (it->w, face_string, face_string_pos, | 14671 | = face_at_string_position (it->w, face_string, face_string_pos, |
| 14669 | 0, it->region_beg_charpos, | 14672 | 0, it->region_beg_charpos, |
| @@ -14712,7 +14715,7 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 14712 | while (i < nglyphs) | 14715 | while (i < nglyphs) |
| 14713 | { | 14716 | { |
| 14714 | struct glyph *glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; | 14717 | struct glyph *glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; |
| 14715 | 14718 | ||
| 14716 | if (!it->truncate_lines_p | 14719 | if (!it->truncate_lines_p |
| 14717 | && x + glyph->pixel_width > max_x) | 14720 | && x + glyph->pixel_width > max_x) |
| 14718 | { | 14721 | { |
| @@ -14807,7 +14810,7 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 14807 | } | 14810 | } |
| 14808 | 14811 | ||
| 14809 | it->face_id = saved_face_id; | 14812 | it->face_id = saved_face_id; |
| 14810 | 14813 | ||
| 14811 | /* Value is number of columns displayed. */ | 14814 | /* Value is number of columns displayed. */ |
| 14812 | return it->hpos - hpos_at_start; | 14815 | return it->hpos - hpos_at_start; |
| 14813 | } | 14816 | } |
| @@ -14828,7 +14831,7 @@ invisible_p (propval, list) | |||
| 14828 | Lisp_Object list; | 14831 | Lisp_Object list; |
| 14829 | { | 14832 | { |
| 14830 | register Lisp_Object tail, proptail; | 14833 | register Lisp_Object tail, proptail; |
| 14831 | 14834 | ||
| 14832 | for (tail = list; CONSP (tail); tail = XCDR (tail)) | 14835 | for (tail = list; CONSP (tail); tail = XCDR (tail)) |
| 14833 | { | 14836 | { |
| 14834 | register Lisp_Object tem; | 14837 | register Lisp_Object tem; |
| @@ -14838,7 +14841,7 @@ invisible_p (propval, list) | |||
| 14838 | if (CONSP (tem) && EQ (propval, XCAR (tem))) | 14841 | if (CONSP (tem) && EQ (propval, XCAR (tem))) |
| 14839 | return NILP (XCDR (tem)) ? 1 : 2; | 14842 | return NILP (XCDR (tem)) ? 1 : 2; |
| 14840 | } | 14843 | } |
| 14841 | 14844 | ||
| 14842 | if (CONSP (propval)) | 14845 | if (CONSP (propval)) |
| 14843 | { | 14846 | { |
| 14844 | for (proptail = propval; CONSP (proptail); proptail = XCDR (proptail)) | 14847 | for (proptail = propval; CONSP (proptail); proptail = XCDR (proptail)) |
| @@ -14856,7 +14859,7 @@ invisible_p (propval, list) | |||
| 14856 | } | 14859 | } |
| 14857 | } | 14860 | } |
| 14858 | } | 14861 | } |
| 14859 | 14862 | ||
| 14860 | return 0; | 14863 | return 0; |
| 14861 | } | 14864 | } |
| 14862 | 14865 | ||
| @@ -14873,7 +14876,7 @@ syms_of_xdisp () | |||
| 14873 | 14876 | ||
| 14874 | Vmessage_stack = Qnil; | 14877 | Vmessage_stack = Qnil; |
| 14875 | staticpro (&Vmessage_stack); | 14878 | staticpro (&Vmessage_stack); |
| 14876 | 14879 | ||
| 14877 | Qinhibit_redisplay = intern ("inhibit-redisplay"); | 14880 | Qinhibit_redisplay = intern ("inhibit-redisplay"); |
| 14878 | staticpro (&Qinhibit_redisplay); | 14881 | staticpro (&Qinhibit_redisplay); |
| 14879 | 14882 | ||
| @@ -14910,7 +14913,7 @@ syms_of_xdisp () | |||
| 14910 | 14913 | ||
| 14911 | staticpro (&Qredisplay_end_trigger_functions); | 14914 | staticpro (&Qredisplay_end_trigger_functions); |
| 14912 | Qredisplay_end_trigger_functions = intern ("redisplay-end-trigger-functions"); | 14915 | Qredisplay_end_trigger_functions = intern ("redisplay-end-trigger-functions"); |
| 14913 | 14916 | ||
| 14914 | staticpro (&Qinhibit_point_motion_hooks); | 14917 | staticpro (&Qinhibit_point_motion_hooks); |
| 14915 | Qinhibit_point_motion_hooks = intern ("inhibit-point-motion-hooks"); | 14918 | Qinhibit_point_motion_hooks = intern ("inhibit-point-motion-hooks"); |
| 14916 | 14919 | ||
| @@ -14982,7 +14985,7 @@ syms_of_xdisp () | |||
| 14982 | last_arrow_string = Qnil; | 14985 | last_arrow_string = Qnil; |
| 14983 | staticpro (&last_arrow_position); | 14986 | staticpro (&last_arrow_position); |
| 14984 | staticpro (&last_arrow_string); | 14987 | staticpro (&last_arrow_string); |
| 14985 | 14988 | ||
| 14986 | echo_buffer[0] = echo_buffer[1] = Qnil; | 14989 | echo_buffer[0] = echo_buffer[1] = Qnil; |
| 14987 | staticpro (&echo_buffer[0]); | 14990 | staticpro (&echo_buffer[0]); |
| 14988 | staticpro (&echo_buffer[1]); | 14991 | staticpro (&echo_buffer[1]); |
| @@ -14996,7 +14999,7 @@ syms_of_xdisp () | |||
| 14996 | 14999 | ||
| 14997 | mode_line_proptrans_alist = Qnil; | 15000 | mode_line_proptrans_alist = Qnil; |
| 14998 | staticpro (&mode_line_proptrans_alist); | 15001 | staticpro (&mode_line_proptrans_alist); |
| 14999 | 15002 | ||
| 15000 | DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace, | 15003 | DEFVAR_LISP ("show-trailing-whitespace", &Vshow_trailing_whitespace, |
| 15001 | doc: /* Non-nil means highlight trailing whitespace. | 15004 | doc: /* Non-nil means highlight trailing whitespace. |
| 15002 | The face used for trailing whitespace is `trailing-whitespace'. */); | 15005 | The face used for trailing whitespace is `trailing-whitespace'. */); |
| @@ -15123,14 +15126,14 @@ Each function is called with two arguments, the window | |||
| 15123 | and its new display-start position. Note that the value of `window-end' | 15126 | and its new display-start position. Note that the value of `window-end' |
| 15124 | is not valid when these functions are called. */); | 15127 | is not valid when these functions are called. */); |
| 15125 | Vwindow_scroll_functions = Qnil; | 15128 | Vwindow_scroll_functions = Qnil; |
| 15126 | 15129 | ||
| 15127 | DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p, | 15130 | DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p, |
| 15128 | doc: /* *Non-nil means automatically resize tool-bars. | 15131 | doc: /* *Non-nil means automatically resize tool-bars. |
| 15129 | This increases a tool-bar's height if not all tool-bar items are visible. | 15132 | This increases a tool-bar's height if not all tool-bar items are visible. |
| 15130 | It decreases a tool-bar's height when it would display blank lines | 15133 | It decreases a tool-bar's height when it would display blank lines |
| 15131 | otherwise. */); | 15134 | otherwise. */); |
| 15132 | auto_resize_tool_bars_p = 1; | 15135 | auto_resize_tool_bars_p = 1; |
| 15133 | 15136 | ||
| 15134 | DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p, | 15137 | DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p, |
| 15135 | doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */); | 15138 | doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */); |
| 15136 | auto_raise_tool_bar_buttons_p = 1; | 15139 | auto_raise_tool_bar_buttons_p = 1; |
| @@ -15184,7 +15187,7 @@ go back to their normal size. */); | |||
| 15184 | doc: /* *Non-nil means display a hollow cursor in non-selected windows. | 15187 | doc: /* *Non-nil means display a hollow cursor in non-selected windows. |
| 15185 | nil means don't display a cursor there. */); | 15188 | nil means don't display a cursor there. */); |
| 15186 | cursor_in_non_selected_windows = 1; | 15189 | cursor_in_non_selected_windows = 1; |
| 15187 | 15190 | ||
| 15188 | DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, | 15191 | DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, |
| 15189 | doc: /* *Non-nil means scroll the display automatically to make point visible. */); | 15192 | doc: /* *Non-nil means scroll the display automatically to make point visible. */); |
| 15190 | automatic_hscrolling_p = 1; | 15193 | automatic_hscrolling_p = 1; |
| @@ -15211,12 +15214,12 @@ scroll more than the value given by the scroll step. | |||
| 15211 | Note that the lower bound for automatic hscrolling specified by `scroll-left' | 15214 | Note that the lower bound for automatic hscrolling specified by `scroll-left' |
| 15212 | and `scroll-right' overrides this variable's effect. */); | 15215 | and `scroll-right' overrides this variable's effect. */); |
| 15213 | Vhscroll_step = make_number (0); | 15216 | Vhscroll_step = make_number (0); |
| 15214 | 15217 | ||
| 15215 | DEFVAR_LISP ("image-types", &Vimage_types, | 15218 | DEFVAR_LISP ("image-types", &Vimage_types, |
| 15216 | doc: /* List of supported image types. | 15219 | doc: /* List of supported image types. |
| 15217 | Each element of the list is a symbol for a supported image type. */); | 15220 | Each element of the list is a symbol for a supported image type. */); |
| 15218 | Vimage_types = Qnil; | 15221 | Vimage_types = Qnil; |
| 15219 | 15222 | ||
| 15220 | DEFVAR_BOOL ("message-truncate-lines", &message_truncate_lines, | 15223 | DEFVAR_BOOL ("message-truncate-lines", &message_truncate_lines, |
| 15221 | doc: /* If non-nil, messages are truncated instead of resizing the echo area. | 15224 | doc: /* If non-nil, messages are truncated instead of resizing the echo area. |
| 15222 | Bind this around calls to `message' to let it take effect. */); | 15225 | Bind this around calls to `message' to let it take effect. */); |
| @@ -15226,7 +15229,7 @@ Bind this around calls to `message' to let it take effect. */); | |||
| 15226 | doc: /* Normal hook run for clicks on menu bar, before displaying a submenu. | 15229 | doc: /* Normal hook run for clicks on menu bar, before displaying a submenu. |
| 15227 | Can be used to update submenus whose contents should vary. */); | 15230 | Can be used to update submenus whose contents should vary. */); |
| 15228 | Vmenu_bar_update_hook = Qnil; | 15231 | Vmenu_bar_update_hook = Qnil; |
| 15229 | 15232 | ||
| 15230 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, | 15233 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, |
| 15231 | doc: /* Non-nil means don't update menu bars. Internal use only. */); | 15234 | doc: /* Non-nil means don't update menu bars. Internal use only. */); |
| 15232 | inhibit_menubar_update = 0; | 15235 | inhibit_menubar_update = 0; |
| @@ -15285,7 +15288,7 @@ init_xdisp () | |||
| 15285 | scratch_glyph_row.glyphs[TEXT_AREA + 1] | 15288 | scratch_glyph_row.glyphs[TEXT_AREA + 1] |
| 15286 | = scratch_glyphs + MAX_SCRATCH_GLYPHS; | 15289 | = scratch_glyphs + MAX_SCRATCH_GLYPHS; |
| 15287 | 15290 | ||
| 15288 | /* The default ellipsis glyphs `...'. */ | 15291 | /* The default ellipsis glyphs `...'. */ |
| 15289 | for (i = 0; i < 3; ++i) | 15292 | for (i = 0; i < 3; ++i) |
| 15290 | default_invis_vector[i] = make_number ('.'); | 15293 | default_invis_vector[i] = make_number ('.'); |
| 15291 | } | 15294 | } |
| @@ -15299,7 +15302,7 @@ init_xdisp () | |||
| 15299 | frame_title_ptr = NULL; | 15302 | frame_title_ptr = NULL; |
| 15300 | } | 15303 | } |
| 15301 | #endif /* HAVE_WINDOW_SYSTEM */ | 15304 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 15302 | 15305 | ||
| 15303 | help_echo_showing_p = 0; | 15306 | help_echo_showing_p = 0; |
| 15304 | } | 15307 | } |
| 15305 | 15308 | ||