diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-07-02 12:39:47 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-07-02 12:39:47 +0300 |
commit | 55d38fc89f5aeb9a73c9a8e13914fbb8a9a6a1af (patch) | |
tree | 46a5bde90a8759582c0c3f7071b7a533056eaa75 /src/nsterm.m | |
parent | a5ec5c073a182aa014d9d753f14751248ea5c9a7 (diff) | |
download | emacs-55d38fc89f5aeb9a73c9a8e13914fbb8a9a6a1af.tar.gz |
Rename FACE_OPT_FROM_ID to FACE_FROM_ID_OR_NULL
* src/dispextern.h (FACE_FROM_ID_OR_NULL): Renamed from
FACE_OPT_FROM_ID; all callers changed.
* src/xdisp.c (extend_face_to_end_of_line): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face is immediately
dereferenced.
(fill_gstring_glyph_string): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
when the glyph string is drawn.
(BUILD_COMPOSITE_GLYPH_STRING): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
in fill_composite_glyph_string.
(calc_line_height_property): Call FACE_FROM_ID_OR_NULL rather that
FACE_FROM_ID, since the function and its caller can cope with that
situation. Conflate 3 tests of missing face or font into just
one.
* src/xfaces.c (Fx_list_fonts, Fface_font, lookup_face): Call
FACE_FROM_ID_OR_NULL rather that FACE_FROM_ID, since these
functions can cope with that situation.
(lookup_derived_face): Don't call FACE_FROM_ID if the result will
not be used.
* src/w32console.c (w32_face_attributes): Remove redundant 'eassert'.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r-- | src/nsterm.m | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 4b887ec0b50..4027f5c4615 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2882,7 +2882,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, ns_clip_to_row (w, glyph_row, TEXT_AREA, NO); /* do ns_focus(f, &r, 1); if remove */ - face = FACE_OPT_FROM_ID (f, phys_cursor_glyph->face_id); + face = FACE_FROM_ID_OR_NULL (f, phys_cursor_glyph->face_id); if (face && NS_FACE_BACKGROUND (face) == ns_index_color (FRAME_CURSOR_COLOR (f), f)) { @@ -2954,7 +2954,7 @@ ns_draw_vertical_window_border (struct window *w, int x, int y0, int y1) NSTRACE ("ns_draw_vertical_window_border"); - face = FACE_OPT_FROM_ID (f, VERTICAL_BORDER_FACE_ID); + face = FACE_FROM_ID_OR_NULL (f, VERTICAL_BORDER_FACE_ID); ns_focus (f, &r, 1); if (face) @@ -2977,7 +2977,7 @@ ns_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) NSTRACE ("ns_draw_window_divider"); - face = FACE_OPT_FROM_ID (f, WINDOW_DIVIDER_FACE_ID); + face = FACE_FROM_ID_OR_NULL (f, WINDOW_DIVIDER_FACE_ID); ns_focus (f, &r, 1); if (face) @@ -3311,9 +3311,10 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s) if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_OPT_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID_OR_NULL (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) - face = FACE_OPT_FROM_ID (s->f, MOUSE_FACE_ID); + face = FACE_FROM_ID_OR_NULL (s->f, MOUSE_FACE_ID); } else face = s->face; @@ -3379,8 +3380,8 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p) if (s->hl == DRAW_MOUSE_FACE) { face - = FACE_OPT_FROM_ID (s->f, - MOUSE_HL_INFO (s->f)->mouse_face_face_id); + = FACE_FROM_ID_OR_NULL (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -3446,7 +3447,8 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) with its background color), we must clear just the image area. */ if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_OPT_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID_OR_NULL (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } @@ -3563,8 +3565,8 @@ ns_dumpglyphs_stretch (struct glyph_string *s) if (s->hl == DRAW_MOUSE_FACE) { - face = FACE_OPT_FROM_ID (s->f, - MOUSE_HL_INFO (s->f)->mouse_face_face_id); + face = FACE_FROM_ID_OR_NULL (s->f, + MOUSE_HL_INFO (s->f)->mouse_face_face_id); if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } |