+2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Make --without-x compatible with --enable-gcc-warnings.
+ * configure.ac: If both --without-x and --enable-gcc-warnings are
+ specified, use -Wno-unused-variable, -Wno-unused-but-set-variable
+ and -Wno-unused-but-set-parameter.
+
2013-09-04 Paul Eggert <eggert@cs.ucla.edu>
Makefile improvements.
## $window_system is now set to the window system we will
## ultimately use.
+if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
+ # Too many warnings for now.
+ gl_WARN_ADD([-Wno-unused-variable])
+ gl_WARN_ADD([-Wno-unused-but-set-variable])
+ gl_WARN_ADD([-Wno-unused-but-set-parameter])
+fi
+
term_header=
HAVE_X_WINDOWS=no
HAVE_X11=no
+2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Make --without-x compatible with --enable-gcc-warnings.
+ * font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM.
+ * font.h (struct font_driver): Move draw, get_bitmap and free_bitmap
+ members under HAVE_WINDOW_SYSTEM.
+ * keyboard.c (make_lispy_focus_out): Likewise.
+ (record_menu_key): Move under HAVE_MENUS.
+ * xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and
+ THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM.
+ (syms_of_xdisp): Adjust user.
+ (window_box_edges): Define only if HAVE_WINDOW_SYSTEM.
+ (start_hourglass, cancel_hourglass):
+ * xfaces.c (toplevel): Likewise with PT_PER_INCH,
+ clear_font_table_count, CLEAR_FONT_TABLE_COUNT
+ and CLEAR_FONT_TABLE_NFONTS.
+ (set_font_frame_param, clear_face_gcs, realize_non_ascii_face):
+ Declare only if HAVE_WINDOW_SYSTEM.
+ (lface_same_font_attributes_p, clear_face_gcs): Define only
+ if HAVE_WINDOW_SYSTEM.
+
2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
* frame.c (check_minibuf_window): Update 'frame' with frame pointer.
struct font_driver_list *root = f ? f->font_driver_list : font_driver_list;
struct font_driver_list *prev, *list;
+#ifdef HAVE_WINDOW_SYSTEM
if (f && ! driver->draw)
error ("Unusable font driver for a frame: %s",
SDATA (SYMBOL_NAME (driver->type)));
+#endif /* HAVE_WINDOW_SYSTEM */
for (prev = NULL, list = root; list; prev = list, list = list->next)
if (EQ (list->driver->type, driver->type))
unsigned *code, int nglyphs,
struct font_metrics *metrics);
+#ifdef HAVE_WINDOW_SYSTEM
+
/* Optional.
Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
position of frame F with S->FACE and S->GC. If WITH_BACKGROUND,
Free bitmap data in BITMAP. */
void (*free_bitmap) (struct font *font, struct font_bitmap *bitmap);
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Optional.
Return an outline data for glyph-code CODE of FONT. The format
of the outline data depends on the font-driver. */
Lisp_Object *, ptrdiff_t);
static Lisp_Object make_lispy_switch_frame (Lisp_Object);
static Lisp_Object make_lispy_focus_in (Lisp_Object);
+#ifdef HAVE_WINDOW_SYSTEM
static Lisp_Object make_lispy_focus_out (Lisp_Object);
+#endif /* HAVE_WINDOW_SYSTEM */
static bool help_char_p (Lisp_Object);
static void save_getcjmp (sys_jmp_buf);
static void restore_getcjmp (sys_jmp_buf);
RETURN_UNGCPRO (c);
}
+#ifdef HAVE_MENUS
+
/* Record a key that came from a mouse menu.
Record it for echoing, for this-command-keys, and so on. */
num_input_events++;
}
+#endif /* HAVE_MENUS */
+
/* Return true if should recognize C as "the help character". */
static bool
{
return list2 (Qfocus_in, frame);
}
+
+#ifdef HAVE_WINDOW_SYSTEM
+
static Lisp_Object
make_lispy_focus_out (Lisp_Object frame)
{
return list2 (Qfocus_out, frame);
}
-\f
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Manipulating modifiers. */
/* Parse the name of SYMBOL, and return the set of modifiers it contains.
/* Platform-independent portion of hourglass implementation. */
+#ifdef HAVE_WINDOW_SYSTEM
+
/* Non-zero means an hourglass cursor is currently shown. */
int hourglass_shown_p;
an hourglass cursor on all frames. */
struct atimer *hourglass_atimer;
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Name of the face used to display glyphless characters. */
Lisp_Object Qglyphless_char;
/* Method symbols for Vglyphless_char_display. */
static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
-/* Default pixel width of `thin-space' display method. */
-#define THIN_SPACE_WIDTH 1
-
/* Default number of seconds to wait before displaying an hourglass
cursor. */
#define DEFAULT_HOURGLASS_DELAY 1
-\f
+#ifdef HAVE_WINDOW_SYSTEM
+
+/* Default pixel width of `thin-space' display method. */
+#define THIN_SPACE_WIDTH 1
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Function prototypes. */
static void setup_for_ellipsis (struct it *, int);
}
}
+#ifdef HAVE_WINDOW_SYSTEM
/* Get the bounding box of the display area AREA of window W, without
mode lines and both fringes of the window. Return in *TOP_LEFT_X
*bottom_right_y += *top_left_y;
}
+#endif /* HAVE_WINDOW_SYSTEM */
-\f
/***********************************************************************
Utilities
***********************************************************************/
doc: /* Seconds to wait before displaying an hourglass pointer when Emacs is busy. */);
Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
+#ifdef HAVE_WINDOW_SYSTEM
hourglass_atimer = NULL;
hourglass_shown_p = 0;
+#endif /* HAVE_WINDOW_SYSTEM */
DEFSYM (Qglyphless_char, "glyphless-char");
DEFSYM (Qhex_code, "hex-code");
help_echo_showing_p = 0;
}
+#ifdef HAVE_WINDOW_SYSTEM
+
/* Platform-independent portion of hourglass implementation. */
/* Cancel a currently active hourglass timer, and start a new one. */
void
start_hourglass (void)
{
-#if defined (HAVE_WINDOW_SYSTEM)
struct timespec delay;
cancel_hourglass ();
hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
show_hourglass, NULL);
-#endif
}
void
cancel_hourglass (void)
{
-#if defined (HAVE_WINDOW_SYSTEM)
if (hourglass_atimer)
{
cancel_atimer (hourglass_atimer);
if (hourglass_shown_p)
hide_hourglass ();
-#endif
}
+
+#endif /* HAVE_WINDOW_SYSTEM */
#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
#define GCGraphicsExposures 0
#endif /* HAVE_NS */
+
+/* Number of pt per inch (from the TeXbook). */
+
+#define PT_PER_INCH 72.27
+
#endif /* HAVE_WINDOW_SYSTEM */
#include "buffer.h"
#include <c-ctype.h>
-/* Number of pt per inch (from the TeXbook). */
-
-#define PT_PER_INCH 72.27
-
/* Non-zero if face attribute ATTR is unspecified. */
#define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified)
static Lisp_Object Qtty_color_alist;
+#ifdef HAVE_WINDOW_SYSTEM
+
/* Counter for calls to clear_face_cache. If this counter reaches
CLEAR_FONT_TABLE_COUNT, and a frame has more than
CLEAR_FONT_TABLE_NFONTS load, unused fonts are freed. */
#define CLEAR_FONT_TABLE_COUNT 100
#define CLEAR_FONT_TABLE_NFONTS 10
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Non-zero means face attributes have been changed since the last
redisplay. Used in redisplay_internal. */
static int menu_face_changed_default;
-\f
-/* Function prototypes. */
-
-struct table_entry;
struct named_merge_point;
-static void set_font_frame_param (Lisp_Object, Lisp_Object);
static struct face *realize_face (struct face_cache *, Lisp_Object *,
int);
-static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
- struct face *);
static struct face *realize_x_face (struct face_cache *, Lisp_Object *);
static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
static bool realize_basic_faces (struct frame *);
static bool realize_default_face (struct frame *);
static void realize_named_face (struct frame *, Lisp_Object, int);
static struct face_cache *make_face_cache (struct frame *);
-static void clear_face_gcs (struct face_cache *);
static void free_face_cache (struct face_cache *);
static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *,
int, struct named_merge_point *);
-\f
+#ifdef HAVE_WINDOW_SYSTEM
+static void set_font_frame_param (Lisp_Object, Lisp_Object);
+static void clear_face_gcs (struct face_cache *);
+static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
+ struct face *);
+#endif /* HAVE_WINDOW_SYSTEM */
+
/***********************************************************************
Utilities
***********************************************************************/
^ XHASH (v[LFACE_HEIGHT_INDEX]));
}
+#ifdef HAVE_WINDOW_SYSTEM
/* Return non-zero if LFACE1 and LFACE2 specify the same font (without
considering charsets/registries). They do if they specify the same
);
}
+#endif /* HAVE_WINDOW_SYSTEM */
-\f
/***********************************************************************
Realized Faces
***********************************************************************/
return c;
}
+#ifdef HAVE_WINDOW_SYSTEM
/* Clear out all graphics contexts for all realized faces, except for
the basic faces. This should be done from time to time just to avoid
{
if (c && FRAME_WINDOW_P (c->f))
{
-#ifdef HAVE_WINDOW_SYSTEM
int i;
for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i)
{
unblock_input ();
}
}
-#endif /* HAVE_WINDOW_SYSTEM */
}
}
+#endif /* HAVE_WINDOW_SYSTEM */
/* Free all realized faces in face cache C, including basic faces.
C may be null. If faces are freed, make sure the frame's current