/* Terminal control module for terminals described by TERMCAP
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
#endif
#include <signal.h>
+#include <stdarg.h>
#include "lisp.h"
#include "termchar.h"
char *tparam ();
extern char *tgetstr ();
-
-static void term_clear_mouse_face ();
-static void term_mouse_highlight (struct frame *f, int x, int y);
\f
#ifdef HAVE_GPM
#include <sys/fcntl.h>
#include "buffer.h"
+static void term_clear_mouse_face ();
+static void term_mouse_highlight (struct frame *f, int x, int y);
+
/* The device for which we have enabled gpm support (or NULL). */
struct tty_display_info *gpm_tty = NULL;
cmcheckmagic (tty);
}
+#ifdef HAVE_GPM /* Only used by GPM code. */
+
static void
tty_write_glyphs_with_face (f, string, len, face_id)
register struct frame *f;
cmcheckmagic (tty);
}
-
+#endif
/* An implementation of insert_glyphs for termcap frames. */
static KBOARD *term_get_fkeys_kboard;
static Lisp_Object term_get_fkeys_1 ();
-/* Find the escape codes sent by the function keys for Vfunction_key_map.
+/* Find the escape codes sent by the function keys for Vinput_decode_map.
This function scans the termcap function key sequence entries, and
- adds entries to Vfunction_key_map for each function key it finds. */
+ adds entries to Vinput_decode_map for each function key it finds. */
static void
term_get_fkeys (address, kboard)
KBOARD *kboard = term_get_fkeys_kboard;
/* This can happen if CANNOT_DUMP or with strange options. */
- if (!initialized)
- kboard->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
+ if (!KEYMAPP (kboard->Vinput_decode_map))
+ kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
{
char *sequence = tgetstr (keys[i].cap, address);
if (sequence)
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
+ Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
Fmake_vector (make_number (1),
intern (keys[i].name)));
}
if (k0)
/* Define f0 first, so that f10 takes precedence in case the
key sequences happens to be the same. */
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
+ Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
Fmake_vector (make_number (1), intern ("f0")));
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (k_semi),
+ Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi),
Fmake_vector (make_number (1), intern ("f10")));
}
else if (k0)
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
+ Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
Fmake_vector (make_number (1), intern (k0_name)));
}
if (sequence)
{
sprintf (fkey, "f%d", i);
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
+ Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
Fmake_vector (make_number (1),
intern (fkey)));
}
{ \
char *sequence = tgetstr (cap2, address); \
if (sequence) \
- Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), \
+ Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \
Fmake_vector (make_number (1), \
intern (sym))); \
}
#ifdef MULTI_KBOARD
terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
init_kboard (terminal->kboard);
+ terminal->kboard->Vwindow_system = Qnil;
terminal->kboard->next_kboard = all_kboards;
all_kboards = terminal->kboard;
terminal->kboard->reference_count++;
abort ();
}
-/* VARARGS 1 */
void
-fatal (str, arg1, arg2)
- char *str, *arg1, *arg2;
+fatal (const char *str, ...)
{
+ va_list ap;
+ va_start (ap, str);
fprintf (stderr, "emacs: ");
- fprintf (stderr, str, arg1, arg2);
- fprintf (stderr, "\n");
+ vfprintf (stderr, str, ap);
+ va_end (ap);
fflush (stderr);
exit (1);
}