aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index ad1c044557d..a2b6513e571 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2809,7 +2809,7 @@ init_iterator (struct it *it, struct window *w,
2809 /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */ 2809 /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
2810 if (! NILP (Vface_remapping_alist)) 2810 if (! NILP (Vface_remapping_alist))
2811 remapped_base_face_id 2811 remapped_base_face_id
2812 = lookup_basic_face (XFRAME (w->frame), base_face_id); 2812 = lookup_basic_face (w, XFRAME (w->frame), base_face_id);
2813 2813
2814 /* Use one of the mode line rows of W's desired matrix if 2814 /* Use one of the mode line rows of W's desired matrix if
2815 appropriate. */ 2815 appropriate. */
@@ -4060,7 +4060,7 @@ handle_face_prop (struct it *it)
4060 might be a big deal. */ 4060 might be a big deal. */
4061 base_face_id = it->string_from_prefix_prop_p 4061 base_face_id = it->string_from_prefix_prop_p
4062 ? (!NILP (Vface_remapping_alist) 4062 ? (!NILP (Vface_remapping_alist)
4063 ? lookup_basic_face (it->f, DEFAULT_FACE_ID) 4063 ? lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID)
4064 : DEFAULT_FACE_ID) 4064 : DEFAULT_FACE_ID)
4065 : underlying_face_id (it); 4065 : underlying_face_id (it);
4066 } 4066 }
@@ -4988,7 +4988,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
4988 struct face *f; 4988 struct face *f;
4989 4989
4990 f = FACE_FROM_ID (it->f, 4990 f = FACE_FROM_ID (it->f,
4991 lookup_basic_face (it->f, DEFAULT_FACE_ID)); 4991 lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID));
4992 new_height = (XFLOATINT (it->font_height) 4992 new_height = (XFLOATINT (it->font_height)
4993 * XINT (f->lface[LFACE_HEIGHT_INDEX])); 4993 * XINT (f->lface[LFACE_HEIGHT_INDEX]));
4994 } 4994 }
@@ -5175,12 +5175,12 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5175 5175
5176 if (it) 5176 if (it)
5177 { 5177 {
5178 int face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID); 5178 int face_id = lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID);
5179 5179
5180 if (CONSP (XCDR (XCDR (spec)))) 5180 if (CONSP (XCDR (XCDR (spec))))
5181 { 5181 {
5182 Lisp_Object face_name = XCAR (XCDR (XCDR (spec))); 5182 Lisp_Object face_name = XCAR (XCDR (XCDR (spec)));
5183 int face_id2 = lookup_derived_face (it->f, face_name, 5183 int face_id2 = lookup_derived_face (it->w, it->f, face_name,
5184 FRINGE_FACE_ID, false); 5184 FRINGE_FACE_ID, false);
5185 if (face_id2 >= 0) 5185 if (face_id2 >= 0)
5186 face_id = face_id2; 5186 face_id = face_id2;
@@ -6985,7 +6985,7 @@ merge_escape_glyph_face (struct it *it)
6985 else 6985 else
6986 { 6986 {
6987 /* Merge the `escape-glyph' face into the current face. */ 6987 /* Merge the `escape-glyph' face into the current face. */
6988 face_id = merge_faces (it->f, Qescape_glyph, 0, it->face_id); 6988 face_id = merge_faces (it->w, Qescape_glyph, 0, it->face_id);
6989 last_escape_glyph_frame = it->f; 6989 last_escape_glyph_frame = it->f;
6990 last_escape_glyph_face_id = it->face_id; 6990 last_escape_glyph_face_id = it->face_id;
6991 last_escape_glyph_merged_face_id = face_id; 6991 last_escape_glyph_merged_face_id = face_id;
@@ -7010,7 +7010,7 @@ merge_glyphless_glyph_face (struct it *it)
7010 else 7010 else
7011 { 7011 {
7012 /* Merge the `glyphless-char' face into the current face. */ 7012 /* Merge the `glyphless-char' face into the current face. */
7013 face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id); 7013 face_id = merge_faces (it->w, Qglyphless_char, 0, it->face_id);
7014 last_glyphless_glyph_frame = it->f; 7014 last_glyphless_glyph_frame = it->f;
7015 last_glyphless_glyph_face_id = it->face_id; 7015 last_glyphless_glyph_face_id = it->face_id;
7016 last_glyphless_glyph_merged_face_id = face_id; 7016 last_glyphless_glyph_merged_face_id = face_id;
@@ -7184,7 +7184,7 @@ get_next_display_element (struct it *it)
7184 } 7184 }
7185 7185
7186 face_id = (lface_id 7186 face_id = (lface_id
7187 ? merge_faces (it->f, Qt, lface_id, it->face_id) 7187 ? merge_faces (it->w, Qt, lface_id, it->face_id)
7188 : merge_escape_glyph_face (it)); 7188 : merge_escape_glyph_face (it));
7189 7189
7190 XSETINT (it->ctl_chars[0], g); 7190 XSETINT (it->ctl_chars[0], g);
@@ -7199,7 +7199,7 @@ get_next_display_element (struct it *it)
7199 if (nonascii_space_p && EQ (Vnobreak_char_display, Qt)) 7199 if (nonascii_space_p && EQ (Vnobreak_char_display, Qt))
7200 { 7200 {
7201 /* Merge `nobreak-space' into the current face. */ 7201 /* Merge `nobreak-space' into the current face. */
7202 face_id = merge_faces (it->f, Qnobreak_space, 0, 7202 face_id = merge_faces (it->w, Qnobreak_space, 0,
7203 it->face_id); 7203 it->face_id);
7204 XSETINT (it->ctl_chars[0], ' '); 7204 XSETINT (it->ctl_chars[0], ' ');
7205 ctl_len = 1; 7205 ctl_len = 1;
@@ -7212,7 +7212,7 @@ get_next_display_element (struct it *it)
7212 if (nonascii_hyphen_p && EQ (Vnobreak_char_display, Qt)) 7212 if (nonascii_hyphen_p && EQ (Vnobreak_char_display, Qt))
7213 { 7213 {
7214 /* Merge `nobreak-space' into the current face. */ 7214 /* Merge `nobreak-space' into the current face. */
7215 face_id = merge_faces (it->f, Qnobreak_hyphen, 0, 7215 face_id = merge_faces (it->w, Qnobreak_hyphen, 0,
7216 it->face_id); 7216 it->face_id);
7217 XSETINT (it->ctl_chars[0], '-'); 7217 XSETINT (it->ctl_chars[0], '-');
7218 ctl_len = 1; 7218 ctl_len = 1;
@@ -7232,7 +7232,7 @@ get_next_display_element (struct it *it)
7232 } 7232 }
7233 7233
7234 face_id = (lface_id 7234 face_id = (lface_id
7235 ? merge_faces (it->f, Qt, lface_id, it->face_id) 7235 ? merge_faces (it->w, Qt, lface_id, it->face_id)
7236 : merge_escape_glyph_face (it)); 7236 : merge_escape_glyph_face (it));
7237 7237
7238 /* Draw non-ASCII space/hyphen with escape glyph: */ 7238 /* Draw non-ASCII space/hyphen with escape glyph: */
@@ -7860,7 +7860,7 @@ next_element_from_display_vector (struct it *it)
7860 { 7860 {
7861 int lface_id = GLYPH_CODE_FACE (gc); 7861 int lface_id = GLYPH_CODE_FACE (gc);
7862 if (lface_id > 0) 7862 if (lface_id > 0)
7863 it->face_id = merge_faces (it->f, Qt, lface_id, 7863 it->face_id = merge_faces (it->w, Qt, lface_id,
7864 it->saved_face_id); 7864 it->saved_face_id);
7865 } 7865 }
7866 7866
@@ -7889,7 +7889,7 @@ next_element_from_display_vector (struct it *it)
7889 GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]); 7889 GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]);
7890 7890
7891 if (lface_id > 0) 7891 if (lface_id > 0)
7892 next_face_id = merge_faces (it->f, Qt, lface_id, 7892 next_face_id = merge_faces (it->w, Qt, lface_id,
7893 it->saved_face_id); 7893 it->saved_face_id);
7894 } 7894 }
7895 } 7895 }
@@ -20084,7 +20084,7 @@ append_space_for_newline (struct it *it, bool default_face_p)
20084 /* If the default face was remapped, be sure to use the 20084 /* If the default face was remapped, be sure to use the
20085 remapped face for the appended newline. */ 20085 remapped face for the appended newline. */
20086 if (default_face_p) 20086 if (default_face_p)
20087 it->face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID); 20087 it->face_id = lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID);
20088 else if (it->face_before_selective_p) 20088 else if (it->face_before_selective_p)
20089 it->face_id = it->saved_face_id; 20089 it->face_id = it->saved_face_id;
20090 face = FACE_FROM_ID (it->f, it->face_id); 20090 face = FACE_FROM_ID (it->f, it->face_id);
@@ -20231,8 +20231,9 @@ extend_face_to_end_of_line (struct it *it)
20231 return; 20231 return;
20232 20232
20233 /* The default face, possibly remapped. */ 20233 /* The default face, possibly remapped. */
20234 default_face = FACE_FROM_ID_OR_NULL (f, 20234 default_face = FACE_FROM_ID_OR_NULL (
20235 lookup_basic_face (f, DEFAULT_FACE_ID)); 20235 f,
20236 lookup_basic_face (it->w, f, DEFAULT_FACE_ID));
20236 20237
20237 /* Face extension extends the background and box of IT->face_id 20238 /* Face extension extends the background and box of IT->face_id
20238 to the end of the line. If the background equals the background 20239 to the end of the line. If the background equals the background
@@ -20486,11 +20487,12 @@ trailing_whitespace_p (ptrdiff_t charpos)
20486} 20487}
20487 20488
20488 20489
20489/* Highlight trailing whitespace, if any, in ROW. */ 20490/* Highlight trailing whitespace, if any, in row at IT. */
20490 20491
20491static void 20492static void
20492highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) 20493highlight_trailing_whitespace (struct it *it)
20493{ 20494{
20495 struct glyph_row *row = it->glyph_row;
20494 int used = row->used[TEXT_AREA]; 20496 int used = row->used[TEXT_AREA];
20495 20497
20496 if (used) 20498 if (used)
@@ -20535,7 +20537,7 @@ highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
20535 && glyph->u.ch == ' ')) 20537 && glyph->u.ch == ' '))
20536 && trailing_whitespace_p (glyph->charpos)) 20538 && trailing_whitespace_p (glyph->charpos))
20537 { 20539 {
20538 int face_id = lookup_named_face (f, Qtrailing_whitespace, false); 20540 int face_id = lookup_named_face (it->w, it->f, Qtrailing_whitespace, false);
20539 if (face_id < 0) 20541 if (face_id < 0)
20540 return; 20542 return;
20541 20543
@@ -21107,9 +21109,9 @@ maybe_produce_line_number (struct it *it)
21107 char lnum_buf[INT_STRLEN_BOUND (ptrdiff_t) + 1]; 21109 char lnum_buf[INT_STRLEN_BOUND (ptrdiff_t) + 1];
21108 bool beyond_zv = IT_BYTEPOS (*it) >= ZV_BYTE ? true : false; 21110 bool beyond_zv = IT_BYTEPOS (*it) >= ZV_BYTE ? true : false;
21109 ptrdiff_t lnum_offset = -1; /* to produce 1-based line numbers */ 21111 ptrdiff_t lnum_offset = -1; /* to produce 1-based line numbers */
21110 int lnum_face_id = merge_faces (it->f, Qline_number, 0, DEFAULT_FACE_ID); 21112 int lnum_face_id = merge_faces (it->w, Qline_number, 0, DEFAULT_FACE_ID);
21111 int current_lnum_face_id 21113 int current_lnum_face_id
21112 = merge_faces (it->f, Qline_number_current_line, 0, DEFAULT_FACE_ID); 21114 = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID);
21113 /* Compute point's line number if needed. */ 21115 /* Compute point's line number if needed. */
21114 if ((EQ (Vdisplay_line_numbers, Qrelative) 21116 if ((EQ (Vdisplay_line_numbers, Qrelative)
21115 || EQ (Vdisplay_line_numbers, Qvisual) 21117 || EQ (Vdisplay_line_numbers, Qvisual)
@@ -21559,7 +21561,8 @@ display_line (struct it *it, int cursor_vpos)
21559 portions of the screen will clear with the default face's 21561 portions of the screen will clear with the default face's
21560 background color. */ 21562 background color. */
21561 if (row->reversed_p 21563 if (row->reversed_p
21562 || lookup_basic_face (it->f, DEFAULT_FACE_ID) != DEFAULT_FACE_ID) 21564 || lookup_basic_face (it->w, it->f, DEFAULT_FACE_ID)
21565 != DEFAULT_FACE_ID)
21563 extend_face_to_end_of_line (it); 21566 extend_face_to_end_of_line (it);
21564 break; 21567 break;
21565 } 21568 }
@@ -22192,7 +22195,7 @@ display_line (struct it *it, int cursor_vpos)
22192 22195
22193 /* Highlight trailing whitespace. */ 22196 /* Highlight trailing whitespace. */
22194 if (!NILP (Vshow_trailing_whitespace)) 22197 if (!NILP (Vshow_trailing_whitespace))
22195 highlight_trailing_whitespace (it->f, it->glyph_row); 22198 highlight_trailing_whitespace (it);
22196 22199
22197 /* Compute pixel dimensions of this line. */ 22200 /* Compute pixel dimensions of this line. */
22198 compute_line_metrics (it); 22201 compute_line_metrics (it);
@@ -27862,7 +27865,7 @@ calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
27862 int face_id; 27865 int face_id;
27863 struct face *face; 27866 struct face *face;
27864 27867
27865 face_id = lookup_named_face (it->f, face_name, false); 27868 face_id = lookup_named_face (it->w, it->f, face_name, false);
27866 face = FACE_FROM_ID_OR_NULL (it->f, face_id); 27869 face = FACE_FROM_ID_OR_NULL (it->f, face_id);
27867 if (face == NULL || ((font = face->font) == NULL)) 27870 if (face == NULL || ((font = face->font) == NULL))
27868 return make_number (-1); 27871 return make_number (-1);