* src/composite.c (autocmp_chars): Declare and set 'f' only if
HAVE_WINDOW_SYSTEM.
* src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P)
(FACE_FOR_CHAR): Explicitly discard unused arguments.
* src/font.c (font_open_entity): Declare 'min_width' where it is
first set, and only if HAVE_WINDOW_SYSTEM.
* src/frame.c [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame):
Define _Noreturn version to avoid "suggest attribute noreturn"
compiler warning.
(check_window_system): Declare as _Noreturn.
(Ficonify_frame):
(Fset_frame_position): Don’t declare and set 'f'.
* src/frame.h [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame)
(check_window_system): Add _Noreturn prototypes.
(FRAME_FRINGE_COLS, FRAME_TOTAL_FRINGE_WIDTH)
(FRAME_LEFT_FRINGE_WIDTH, FRAME_RIGHT_FRINGE_WIDTH)
(FRAME_INTERNAL_BORDER_WIDTH, FRAME_RIGHT_DIVIDER_WIDTH)
(FRAME_BOTTOM_DIVIDER_WIDTH): Explicitly discard unused argument.
* src/xdisp.c (handle_single_display_spec): Declare
'fringe_bitmap' only if HAVE_WINDOW_SYSTEM.
(append_space_for_newline): Declare 'g' where it is first set.
(Fmove_point_visually): Declare and set 'target_is_eol_p' only if
HAVE_WINDOW_SYSTEM.
(show_mouse_face): Declare and set 'f' and 'phys_cursor_on_p' only
if HAVE_WINDOW_SYSTEM.
(note_mode_line_or_margin_highlight):
(note_mouse_highlight): Declare and set 'cursor' and 'pointer'
only if HAVE_WINDOW_SYSTEM.
* src/xfaces.c (realize_default_face): Declare and set 'face' only
if HAVE_X_WINDOWS. Remove redundant #ifdef.
Lisp_Object string)
{
ptrdiff_t count = SPECPDL_INDEX ();
Lisp_Object string)
{
ptrdiff_t count = SPECPDL_INDEX ();
+#ifdef HAVE_WINDOW_SYSTEM
struct frame *f = XFRAME (win->frame);
struct frame *f = XFRAME (win->frame);
+#else
+ (void) XFRAME (win->frame);
+#endif
Lisp_Object pos = make_number (charpos);
ptrdiff_t to;
ptrdiff_t pt = PT, pt_byte = PT_BYTE;
Lisp_Object pos = make_number (charpos);
ptrdiff_t to;
ptrdiff_t pt = PT, pt_byte = PT_BYTE;
#else /* not HAVE_WINDOW_SYSTEM */
#else /* not HAVE_WINDOW_SYSTEM */
-#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) true
-#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) ((FACE)->id)
+#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \
+ ((void) (FACE), (void) (CHAR), true)
+#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \
+ ((void) (F), (void) (FACE), (void) (CHAR), (void) (POS), \
+ (void) (OBJECT), (FACE)->id)
#endif /* not HAVE_WINDOW_SYSTEM */
#endif /* not HAVE_WINDOW_SYSTEM */
struct font_driver_list *driver_list;
Lisp_Object objlist, size, val, font_object;
struct font *font;
struct font_driver_list *driver_list;
Lisp_Object objlist, size, val, font_object;
struct font *font;
- int min_width, height, psize;
eassert (FONT_ENTITY_P (entity));
size = AREF (entity, FONT_SIZE_INDEX);
eassert (FONT_ENTITY_P (entity));
size = AREF (entity, FONT_SIZE_INDEX);
Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
font = XFONT_OBJECT (font_object);
Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
font = XFONT_OBJECT (font_object);
- min_width = (font->min_width ? font->min_width
- : font->average_width ? font->average_width
- : font->space_width ? font->space_width
- : 1);
+#ifdef HAVE_WINDOW_SYSTEM
+ int min_width = (font->min_width ? font->min_width
+ : font->average_width ? font->average_width
+ : font->space_width ? font->space_width
+ : 1);
+#endif
int font_ascent, font_descent;
get_font_ascent_descent (font, &font_ascent, &font_descent);
int font_ascent, font_descent;
get_font_ascent_descent (font, &font_ascent, &font_descent);
return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : x_display_list != NULL;
}
return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : x_display_list != NULL;
}
-#endif /* HAVE_WINDOW_SYSTEM */
-
struct frame *
decode_window_system_frame (Lisp_Object frame)
{
struct frame *
decode_window_system_frame (Lisp_Object frame)
{
+#else /* not HAVE_WINDOW_SYSTEM */
+
+_Noreturn void
+decode_window_system_frame (Lisp_Object frame)
+{
+ error ("Window system is not in use");
+}
+
+_Noreturn
+#endif /* not HAVE_WINDOW_SYSTEM */
void
check_window_system (struct frame *f)
{
void
check_window_system (struct frame *f)
{
If omitted, FRAME defaults to the currently selected frame. */)
(Lisp_Object frame)
{
If omitted, FRAME defaults to the currently selected frame. */)
(Lisp_Object frame)
{
+#ifdef HAVE_WINDOW_SYSTEM
struct frame *f = decode_live_frame (frame);
struct frame *f = decode_live_frame (frame);
+#else
+ (void) decode_live_frame (frame);
+#endif
/* Don't allow minibuf_window to remain on an iconified frame. */
check_minibuf_window (frame, EQ (minibuf_window, selected_window));
/* Don't allow minibuf_window to remain on an iconified frame. */
check_minibuf_window (frame, EQ (minibuf_window, selected_window));
bottom edge of FRAME's display. */)
(Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
bottom edge of FRAME's display. */)
(Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
+#ifdef HAVE_WINDOW_SYSTEM
register struct frame *f = decode_live_frame (frame);
register struct frame *f = decode_live_frame (frame);
+#else
+ (void) decode_live_frame (frame);
+#endif
CHECK_TYPE_RANGED_INTEGER (int, x);
CHECK_TYPE_RANGED_INTEGER (int, y);
CHECK_TYPE_RANGED_INTEGER (int, x);
CHECK_TYPE_RANGED_INTEGER (int, y);
extern int frame_default_tool_bar_height;
#endif
extern int frame_default_tool_bar_height;
#endif
-extern struct frame *decode_window_system_frame (Lisp_Object);
extern struct frame *decode_live_frame (Lisp_Object);
extern struct frame *decode_any_frame (Lisp_Object);
extern struct frame *make_initial_frame (void);
extern struct frame *make_frame (bool);
#ifdef HAVE_WINDOW_SYSTEM
extern struct frame *decode_live_frame (Lisp_Object);
extern struct frame *decode_any_frame (Lisp_Object);
extern struct frame *make_initial_frame (void);
extern struct frame *make_frame (bool);
#ifdef HAVE_WINDOW_SYSTEM
+extern void check_window_system (struct frame *);
+extern struct frame *decode_window_system_frame (Lisp_Object);
extern struct frame *make_minibuffer_frame (void);
extern struct frame *make_frame_without_minibuffer (Lisp_Object,
struct kboard *,
Lisp_Object);
extern bool window_system_available (struct frame *);
#else /* not HAVE_WINDOW_SYSTEM */
extern struct frame *make_minibuffer_frame (void);
extern struct frame *make_frame_without_minibuffer (Lisp_Object,
struct kboard *,
Lisp_Object);
extern bool window_system_available (struct frame *);
#else /* not HAVE_WINDOW_SYSTEM */
+extern _Noreturn void check_window_system (struct frame *);
+extern _Noreturn void decode_window_system_frame (Lisp_Object);
#define window_system_available(f) ((void) (f), false)
#endif /* HAVE_WINDOW_SYSTEM */
#define window_system_available(f) ((void) (f), false)
#endif /* HAVE_WINDOW_SYSTEM */
-extern void check_window_system (struct frame *);
extern void frame_make_pointer_invisible (struct frame *);
extern void frame_make_pointer_visible (struct frame *);
extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
extern void frame_make_pointer_invisible (struct frame *);
extern void frame_make_pointer_visible (struct frame *);
extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
#else /* not HAVE_WINDOW_SYSTEM */
#else /* not HAVE_WINDOW_SYSTEM */
-#define FRAME_FRINGE_COLS(F) 0
-#define FRAME_TOTAL_FRINGE_WIDTH(F) 0
-#define FRAME_LEFT_FRINGE_WIDTH(F) 0
-#define FRAME_RIGHT_FRINGE_WIDTH(F) 0
-#define FRAME_INTERNAL_BORDER_WIDTH(F) 0
-#define FRAME_RIGHT_DIVIDER_WIDTH(F) 0
-#define FRAME_BOTTOM_DIVIDER_WIDTH(F) 0
+#define FRAME_FRINGE_COLS(F) ((void) (F), 0)
+#define FRAME_TOTAL_FRINGE_WIDTH(F) ((void) (F), 0)
+#define FRAME_LEFT_FRINGE_WIDTH(F) ((void) (F), 0)
+#define FRAME_RIGHT_FRINGE_WIDTH(F) ((void) (F), 0)
+#define FRAME_INTERNAL_BORDER_WIDTH(F) ((void) (F), 0)
+#define FRAME_RIGHT_DIVIDER_WIDTH(F) ((void) (F), 0)
+#define FRAME_BOTTOM_DIVIDER_WIDTH(F) ((void) (F), 0)
#endif /* not HAVE_WINDOW_SYSTEM */
\f
#endif /* not HAVE_WINDOW_SYSTEM */
\f
|| EQ (XCAR (spec), Qright_fringe))
&& CONSP (XCDR (spec)))
{
|| EQ (XCAR (spec), Qright_fringe))
&& CONSP (XCDR (spec)))
{
if (it)
{
if (!FRAME_WINDOW_P (it->f))
if (it)
{
if (!FRAME_WINDOW_P (it->f))
return 1;
#ifdef HAVE_WINDOW_SYSTEM
return 1;
#ifdef HAVE_WINDOW_SYSTEM
value = XCAR (XCDR (spec));
if (!SYMBOLP (value)
|| !(fringe_bitmap = lookup_fringe_bitmap (value)))
value = XCAR (XCDR (spec));
if (!SYMBOLP (value)
|| !(fringe_bitmap = lookup_fringe_bitmap (value)))
struct text_pos saved_pos;
Lisp_Object saved_object;
struct face *face;
struct text_pos saved_pos;
Lisp_Object saved_object;
struct face *face;
saved_object = it->object;
saved_pos = it->position;
saved_object = it->object;
saved_pos = it->position;
/* Make sure this space glyph has the right ascent and
descent values, or else cursor at end of line will look
funny, and height of empty lines will be incorrect. */
/* Make sure this space glyph has the right ascent and
descent values, or else cursor at end of line will look
funny, and height of empty lines will be incorrect. */
- g = it->glyph_row->glyphs[TEXT_AREA] + n;
+ struct glyph *g = it->glyph_row->glyphs[TEXT_AREA] + n;
struct font *font = face->font ? face->font : FRAME_FONT (it->f);
if (n == 0)
{
struct font *font = face->font ? face->font : FRAME_FONT (it->f);
if (n == 0)
{
int pt_x, target_x, pixel_width, pt_vpos;
bool at_eol_p;
bool overshoot_expected = false;
int pt_x, target_x, pixel_width, pt_vpos;
bool at_eol_p;
bool overshoot_expected = false;
+#ifdef HAVE_WINDOW_SYSTEM
bool target_is_eol_p = false;
bool target_is_eol_p = false;
/* Setup the arena. */
SET_TEXT_POS (pt, PT, PT_BYTE);
/* Setup the arena. */
SET_TEXT_POS (pt, PT, PT_BYTE);
{
move_it_by_lines (&it, -1);
target_x = it.last_visible_x - !FRAME_WINDOW_P (it.f);
{
move_it_by_lines (&it, -1);
target_x = it.last_visible_x - !FRAME_WINDOW_P (it.f);
+#ifdef HAVE_WINDOW_SYSTEM
/* Under word-wrap, we don't know the x coordinate of
the last character displayed on the previous line,
which immediately precedes the wrap point. To find
/* Under word-wrap, we don't know the x coordinate of
the last character displayed on the previous line,
which immediately precedes the wrap point. To find
show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
{
struct window *w = XWINDOW (hlinfo->mouse_face_window);
show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
{
struct window *w = XWINDOW (hlinfo->mouse_face_window);
+#ifdef HAVE_WINDOW_SYSTEM
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct frame *f = XFRAME (WINDOW_FRAME (w));
+#else
+ (void) XFRAME (WINDOW_FRAME (w));
+#endif
if (/* If window is in the process of being destroyed, don't bother
to do anything. */
if (/* If window is in the process of being destroyed, don't bother
to do anything. */
anymore. This can happen when a window is split. */
&& hlinfo->mouse_face_end_row < w->current_matrix->nrows)
{
anymore. This can happen when a window is split. */
&& hlinfo->mouse_face_end_row < w->current_matrix->nrows)
{
+#ifdef HAVE_WINDOW_SYSTEM
bool phys_cursor_on_p = w->phys_cursor_on_p;
bool phys_cursor_on_p = w->phys_cursor_on_p;
struct glyph_row *row, *first, *last;
first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
struct glyph_row *row, *first, *last;
first = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
#ifdef HAVE_WINDOW_SYSTEM
Display_Info *dpyinfo;
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
#ifdef HAVE_WINDOW_SYSTEM
Display_Info *dpyinfo;
Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil;
Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil;
int dx, dy, width, height;
ptrdiff_t charpos;
Lisp_Object string, object = Qnil;
int dx, dy, width, height;
ptrdiff_t charpos;
Lisp_Object string, object = Qnil;
&& hlinfo->mouse_face_beg_row == vpos )
return;
&& hlinfo->mouse_face_beg_row == vpos )
return;
+#ifdef HAVE_WINDOW_SYSTEM
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
+#else
+ (void) clear_mouse_face (hlinfo);
+#endif
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
mouse_face_shown = true;
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
mouse_face_shown = true;
+#ifdef HAVE_WINDOW_SYSTEM
if (NILP (pointer))
pointer = Qhand;
if (NILP (pointer))
pointer = Qhand;
enum window_part part = ON_NOTHING;
Lisp_Object window;
struct window *w;
enum window_part part = ON_NOTHING;
Lisp_Object window;
struct window *w;
+#ifdef HAVE_WINDOW_SYSTEM
Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil; /* Takes precedence over cursor! */
Cursor cursor = No_Cursor;
Lisp_Object pointer = Qnil; /* Takes precedence over cursor! */
struct buffer *b;
/* When a menu is active, don't highlight because this looks odd. */
struct buffer *b;
/* When a menu is active, don't highlight because this looks odd. */
&& glyph->type == STRETCH_GLYPH
&& glyph->avoid_cursor_p))
{
&& glyph->type == STRETCH_GLYPH
&& glyph->avoid_cursor_p))
{
+#ifndef HAVE_WINDOW_SYSTEM
+ (void) clear_mouse_face (hlinfo);
+#else /* HAVE_WINDOW_SYSTEM */
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
-#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f) && NILP (pointer))
{
if (area != TEXT_AREA)
if (FRAME_WINDOW_P (f) && NILP (pointer))
{
if (area != TEXT_AREA)
else
pointer = Vvoid_text_area_pointer;
}
else
pointer = Vvoid_text_area_pointer;
}
+#endif /* HAVE_WINDOW_SYSTEM */
same_region = coords_in_mouse_face_p (w, hpos, vpos);
same_region = coords_in_mouse_face_p (w, hpos, vpos);
+#ifdef HAVE_WINDOW_SYSTEM
if (same_region)
cursor = No_Cursor;
if (same_region)
cursor = No_Cursor;
/* Check mouse-face highlighting. */
if (! same_region
/* Check mouse-face highlighting. */
if (! same_region
hlinfo->mouse_face_overlay = overlay;
/* Clear the display of the old active region, if any. */
hlinfo->mouse_face_overlay = overlay;
/* Clear the display of the old active region, if any. */
+#ifdef HAVE_WINDOW_SYSTEM
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
+#else
+ (void) clear_mouse_face (hlinfo);
+#endif
/* If no overlay applies, get a text property. */
if (NILP (overlay))
/* If no overlay applies, get a text property. */
if (NILP (overlay))
= face_at_string_position (w, object, pos, 0, &ignore,
glyph->face_id, true);
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
= face_at_string_position (w, object, pos, 0, &ignore,
glyph->face_id, true);
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
+#ifdef HAVE_WINDOW_SYSTEM
: XFASTINT (after),
before_string, after_string,
disp_string);
: XFASTINT (after),
before_string, after_string,
disp_string);
+#ifdef HAVE_WINDOW_SYSTEM
struct face_cache *c = FRAME_FACE_CACHE (f);
Lisp_Object lface;
Lisp_Object attrs[LFACE_VECTOR_SIZE];
struct face_cache *c = FRAME_FACE_CACHE (f);
Lisp_Object lface;
Lisp_Object attrs[LFACE_VECTOR_SIZE];
/* If the `default' face is not yet known, create it. */
lface = lface_from_face_name (f, Qdefault, false);
/* If the `default' face is not yet known, create it. */
lface = lface_from_face_name (f, Qdefault, false);
eassert (lface_fully_specified_p (XVECTOR (lface)->contents));
check_lface (lface);
memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs);
eassert (lface_fully_specified_p (XVECTOR (lface)->contents));
check_lface (lface);
memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs);
- face = realize_face (c, attrs, DEFAULT_FACE_ID);
-#ifdef HAVE_WINDOW_SYSTEM
-#ifdef HAVE_X_WINDOWS
+#ifndef HAVE_X_WINDOWS
+ (void) realize_face (c, attrs, DEFAULT_FACE_ID);
+#else /* HAVE_X_WINDOWS */
+ struct face *face = realize_face (c, attrs, DEFAULT_FACE_ID);
if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
{
/* This can happen when making a frame on a display that does
if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
{
/* This can happen when making a frame on a display that does
x_set_font (f, LFACE_FONT (lface), Qnil);
}
#endif /* HAVE_X_WINDOWS */
x_set_font (f, LFACE_FONT (lface), Qnil);
}
#endif /* HAVE_X_WINDOWS */
-#endif /* HAVE_WINDOW_SYSTEM */