diff options
| -rw-r--r-- | src/dispnew.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index a4219ead66d..122f77c2962 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1468,9 +1468,11 @@ line_draw_cost (matrix, vpos) | |||
| 1468 | len = 0; | 1468 | len = 0; |
| 1469 | while (beg < end) | 1469 | while (beg < end) |
| 1470 | { | 1470 | { |
| 1471 | GLYPH g = GLYPH_FROM_CHAR_GLYPH (*beg); | 1471 | GLYPH g; |
| 1472 | 1472 | ||
| 1473 | if (g < 0 | 1473 | SET_GLYPH_FROM_CHAR_GLYPH (g, *beg); |
| 1474 | |||
| 1475 | if (GLYPH_INVALID_P (g) < 0 | ||
| 1474 | || GLYPH_SIMPLE_P (glyph_table_base, glyph_table_len, g)) | 1476 | || GLYPH_SIMPLE_P (glyph_table_base, glyph_table_len, g)) |
| 1475 | len += 1; | 1477 | len += 1; |
| 1476 | else | 1478 | else |
| @@ -2175,7 +2177,7 @@ showing_window_margins_p (w) | |||
| 2175 | else if (!NILP (w->left_margin_cols) | 2177 | else if (!NILP (w->left_margin_cols) |
| 2176 | || !NILP (w->right_margin_cols)) | 2178 | || !NILP (w->right_margin_cols)) |
| 2177 | return 1; | 2179 | return 1; |
| 2178 | 2180 | ||
| 2179 | w = NILP (w->next) ? 0 : XWINDOW (w->next); | 2181 | w = NILP (w->next) ? 0 : XWINDOW (w->next); |
| 2180 | } | 2182 | } |
| 2181 | return 0; | 2183 | return 0; |
| @@ -2740,7 +2742,9 @@ build_frame_matrix_from_leaf_window (frame_matrix, w) | |||
| 2740 | struct glyph_matrix *window_matrix; | 2742 | struct glyph_matrix *window_matrix; |
| 2741 | int window_y, frame_y; | 2743 | int window_y, frame_y; |
| 2742 | /* If non-zero, a glyph to insert at the right border of W. */ | 2744 | /* If non-zero, a glyph to insert at the right border of W. */ |
| 2743 | GLYPH right_border_glyph = 0; | 2745 | GLYPH right_border_glyph; |
| 2746 | |||
| 2747 | SET_GLYPH_FROM_CHAR (right_border_glyph, 0); | ||
| 2744 | 2748 | ||
| 2745 | /* Set window_matrix to the matrix we have to add to FRAME_MATRIX. */ | 2749 | /* Set window_matrix to the matrix we have to add to FRAME_MATRIX. */ |
| 2746 | if (w->must_be_updated_p) | 2750 | if (w->must_be_updated_p) |
| @@ -2751,15 +2755,19 @@ build_frame_matrix_from_leaf_window (frame_matrix, w) | |||
| 2751 | if (!WINDOW_RIGHTMOST_P (w)) | 2755 | if (!WINDOW_RIGHTMOST_P (w)) |
| 2752 | { | 2756 | { |
| 2753 | struct Lisp_Char_Table *dp = window_display_table (w); | 2757 | struct Lisp_Char_Table *dp = window_display_table (w); |
| 2758 | Lisp_Object gc; | ||
| 2754 | 2759 | ||
| 2755 | right_border_glyph | 2760 | SET_GLYPH_FROM_CHAR (right_border_glyph, '|'); |
| 2756 | = ((dp && INTEGERP (DISP_BORDER_GLYPH (dp))) | 2761 | if (dp |
| 2757 | ? spec_glyph_lookup_face (w, XINT (DISP_BORDER_GLYPH (dp))) | 2762 | && (gc = DISP_BORDER_GLYPH (dp), GLYPH_CODE_P (gc)) |
| 2758 | : '|'); | 2763 | && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 2764 | { | ||
| 2765 | SET_GLYPH_FROM_GLYPH_CODE (right_border_glyph, gc); | ||
| 2766 | spec_glyph_lookup_face (w, &right_border_glyph); | ||
| 2767 | } | ||
| 2759 | 2768 | ||
| 2760 | if (FAST_GLYPH_FACE (right_border_glyph) <= 0) | 2769 | if (GLYPH_FACE (right_border_glyph) <= 0) |
| 2761 | right_border_glyph | 2770 | SET_GLYPH_FACE (right_border_glyph, VERTICAL_BORDER_FACE_ID); |
| 2762 | = FAST_MAKE_GLYPH (right_border_glyph, VERTICAL_BORDER_FACE_ID); | ||
| 2763 | } | 2771 | } |
| 2764 | } | 2772 | } |
| 2765 | else | 2773 | else |
| @@ -2809,7 +2817,7 @@ build_frame_matrix_from_leaf_window (frame_matrix, w) | |||
| 2809 | 2817 | ||
| 2810 | /* Maybe insert a vertical border between horizontally adjacent | 2818 | /* Maybe insert a vertical border between horizontally adjacent |
| 2811 | windows. */ | 2819 | windows. */ |
| 2812 | if (right_border_glyph) | 2820 | if (GLYPH_CHAR (right_border_glyph) != 0) |
| 2813 | { | 2821 | { |
| 2814 | struct glyph *border = window_row->glyphs[LAST_AREA] - 1; | 2822 | struct glyph *border = window_row->glyphs[LAST_AREA] - 1; |
| 2815 | SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); | 2823 | SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); |
| @@ -2845,21 +2853,19 @@ build_frame_matrix_from_leaf_window (frame_matrix, w) | |||
| 2845 | This is used for glyphs displayed specially and not part of the text; | 2853 | This is used for glyphs displayed specially and not part of the text; |
| 2846 | for instance, vertical separators, truncation markers, etc. */ | 2854 | for instance, vertical separators, truncation markers, etc. */ |
| 2847 | 2855 | ||
| 2848 | GLYPH | 2856 | void |
| 2849 | spec_glyph_lookup_face (w, glyph) | 2857 | spec_glyph_lookup_face (w, glyph) |
| 2850 | struct window *w; | 2858 | struct window *w; |
| 2851 | GLYPH glyph; | 2859 | GLYPH *glyph; |
| 2852 | { | 2860 | { |
| 2853 | int lface_id = FAST_GLYPH_FACE (glyph); | 2861 | int lface_id = GLYPH_FACE (*glyph); |
| 2854 | /* Convert the glyph's specified face to a realized (cache) face. */ | 2862 | /* Convert the glyph's specified face to a realized (cache) face. */ |
| 2855 | if (lface_id > 0) | 2863 | if (lface_id > 0) |
| 2856 | { | 2864 | { |
| 2857 | int face_id = merge_faces (XFRAME (w->frame), | 2865 | int face_id = merge_faces (XFRAME (w->frame), |
| 2858 | Qt, lface_id, DEFAULT_FACE_ID); | 2866 | Qt, lface_id, DEFAULT_FACE_ID); |
| 2859 | glyph | 2867 | SET_GLYPH_FACE (*glyph, face_id); |
| 2860 | = FAST_MAKE_GLYPH (FAST_GLYPH_CHAR (glyph), face_id); | ||
| 2861 | } | 2868 | } |
| 2862 | return glyph; | ||
| 2863 | } | 2869 | } |
| 2864 | 2870 | ||
| 2865 | /* Add spaces to a glyph row ROW in a window matrix. | 2871 | /* Add spaces to a glyph row ROW in a window matrix. |
| @@ -4058,7 +4064,7 @@ redraw_overlapped_rows (w, yb) | |||
| 4058 | { | 4064 | { |
| 4059 | int i; | 4065 | int i; |
| 4060 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 4066 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 4061 | 4067 | ||
| 4062 | /* If rows overlapping others have been changed, the rows being | 4068 | /* If rows overlapping others have been changed, the rows being |
| 4063 | overlapped have to be redrawn. This won't draw lines that have | 4069 | overlapped have to be redrawn. This won't draw lines that have |
| 4064 | already been drawn in update_window_line because overlapped_p in | 4070 | already been drawn in update_window_line because overlapped_p in |
| @@ -4109,7 +4115,7 @@ redraw_overlapping_rows (w, yb) | |||
| 4109 | int i, bottom_y; | 4115 | int i, bottom_y; |
| 4110 | struct glyph_row *row; | 4116 | struct glyph_row *row; |
| 4111 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 4117 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 4112 | 4118 | ||
| 4113 | for (i = 0; i < w->current_matrix->nrows; ++i) | 4119 | for (i = 0; i < w->current_matrix->nrows; ++i) |
| 4114 | { | 4120 | { |
| 4115 | row = w->current_matrix->rows + i; | 4121 | row = w->current_matrix->rows + i; |
| @@ -6196,10 +6202,10 @@ window_change_signal (signalnum) /* If we don't have an argument, */ | |||
| 6196 | continue; | 6202 | continue; |
| 6197 | 6203 | ||
| 6198 | get_tty_size (fileno (tty->input), &width, &height); | 6204 | get_tty_size (fileno (tty->input), &width, &height); |
| 6199 | 6205 | ||
| 6200 | if (width > 5 && height > 2) { | 6206 | if (width > 5 && height > 2) { |
| 6201 | Lisp_Object tail, frame; | 6207 | Lisp_Object tail, frame; |
| 6202 | 6208 | ||
| 6203 | FOR_EACH_FRAME (tail, frame) | 6209 | FOR_EACH_FRAME (tail, frame) |
| 6204 | if (FRAME_TERMCAP_P (XFRAME (frame)) && FRAME_TTY (XFRAME (frame)) == tty) | 6210 | if (FRAME_TERMCAP_P (XFRAME (frame)) && FRAME_TTY (XFRAME (frame)) == tty) |
| 6205 | /* Record the new sizes, but don't reallocate the data | 6211 | /* Record the new sizes, but don't reallocate the data |
| @@ -6208,7 +6214,7 @@ window_change_signal (signalnum) /* If we don't have an argument, */ | |||
| 6208 | change_frame_size (XFRAME (frame), height, width, 0, 1, 0); | 6214 | change_frame_size (XFRAME (frame), height, width, 0, 1, 0); |
| 6209 | } | 6215 | } |
| 6210 | } | 6216 | } |
| 6211 | 6217 | ||
| 6212 | errno = old_errno; | 6218 | errno = old_errno; |
| 6213 | } | 6219 | } |
| 6214 | #endif /* SIGWINCH */ | 6220 | #endif /* SIGWINCH */ |
| @@ -6453,7 +6459,7 @@ currently selected frame. */) | |||
| 6453 | error ("Unknown terminal device"); | 6459 | error ("Unknown terminal device"); |
| 6454 | 6460 | ||
| 6455 | tty = t->display_info.tty; | 6461 | tty = t->display_info.tty; |
| 6456 | 6462 | ||
| 6457 | if (tty->termscript) | 6463 | if (tty->termscript) |
| 6458 | { | 6464 | { |
| 6459 | fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); | 6465 | fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); |
| @@ -6792,7 +6798,7 @@ init_display () | |||
| 6792 | 6798 | ||
| 6793 | /* Construct the space glyph. */ | 6799 | /* Construct the space glyph. */ |
| 6794 | space_glyph.type = CHAR_GLYPH; | 6800 | space_glyph.type = CHAR_GLYPH; |
| 6795 | SET_CHAR_GLYPH_FROM_GLYPH (space_glyph, ' '); | 6801 | SET_CHAR_GLYPH (space_glyph, ' ', DEFAULT_FACE_ID, 0); |
| 6796 | space_glyph.charpos = -1; | 6802 | space_glyph.charpos = -1; |
| 6797 | 6803 | ||
| 6798 | inverse_video = 0; | 6804 | inverse_video = 0; |
| @@ -6963,7 +6969,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ | |||
| 6963 | Ftty_type (selected_frame)), Qnil)); | 6969 | Ftty_type (selected_frame)), Qnil)); |
| 6964 | Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil)); | 6970 | Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil)); |
| 6965 | } | 6971 | } |
| 6966 | 6972 | ||
| 6967 | { | 6973 | { |
| 6968 | struct frame *sf = SELECTED_FRAME (); | 6974 | struct frame *sf = SELECTED_FRAME (); |
| 6969 | int width = FRAME_TOTAL_COLS (sf); | 6975 | int width = FRAME_TOTAL_COLS (sf); |