to denote window system. Adjust comment.
(init_keyboard): Adjust user.
(allocate_kboard): New function.
(syms_of_keyboard):
* nsterm.m (ns_term_init):
* term.c (init_tty):
* w32term.c (w32_create_terminal):
* xterm.c (x_term_init): Use it.
* keyboard.h (init_kboard): Remove prototype.
(allocate_kboard): Add prototype.
+2013-10-10 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * keyboard.c (init_kboard): Now static. Add arg
+ to denote window system. Adjust comment.
+ (init_keyboard): Adjust user.
+ (allocate_kboard): New function.
+ (syms_of_keyboard):
+ * nsterm.m (ns_term_init):
+ * term.c (init_tty):
+ * w32term.c (w32_create_terminal):
+ * xterm.c (x_term_init): Use it.
+ * keyboard.h (init_kboard): Remove prototype.
+ (allocate_kboard): Add prototype.
+
2013-10-10 Barry Fishman <barry_fishman@acm.org> (tiny change)
* image.c (GIFLIB_MAJOR): Ensure it's defined.
so it shouldn't be used all the time. Perhaps we need two
flavors of 'eassert', one for where 'assume' is far more likely
to help or to hurt; but that can be done later.
- Problem reported by Dmitry Andipov in
+ Problem reported by Dmitry Antipov in
<http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00276.html>.
Also, don't include <verify.h>; no longer needed.
return tem;
}
-\f
-/*
- * Set up a new kboard object with reasonable initial values.
- */
-void
-init_kboard (KBOARD *kb)
+/* Set up a new kboard object with reasonable initial values.
+ TYPE is a window system for which this keyboard is used. */
+
+static void
+init_kboard (KBOARD *kb, Lisp_Object type)
{
kset_overriding_terminal_local_map (kb, Qnil);
kset_last_command (kb, Qnil);
kb->reference_count = 0;
kset_system_key_alist (kb, Qnil);
kset_system_key_syms (kb, Qnil);
- kset_window_system (kb, Qt); /* Unset. */
+ kset_window_system (kb, type);
kset_input_decode_map (kb, Fmake_sparse_keymap (Qnil));
kset_local_function_key_map (kb, Fmake_sparse_keymap (Qnil));
Fset_keymap_parent (KVAR (kb, Vlocal_function_key_map), Vfunction_key_map);
kset_default_minibuffer_frame (kb, Qnil);
}
+/* Allocate and basically initialize keyboard
+ object to use with window system TYPE. */
+
+KBOARD *
+allocate_kboard (Lisp_Object type)
+{
+ KBOARD *kb = xmalloc (sizeof *kb);
+
+ init_kboard (kb, type);
+ kb->next_kboard = all_kboards;
+ all_kboards = kb;
+ return kb;
+}
+
/*
* Destroy the contents of a kboard object, but not the object itself.
* We use this just before deleting it, or if we're going to initialize
current_kboard = initial_kboard;
/* Re-initialize the keyboard again. */
wipe_kboard (current_kboard);
- init_kboard (current_kboard);
/* A value of nil for Vwindow_system normally means a tty, but we also use
it for the initial terminal since there is no window system there. */
- kset_window_system (current_kboard, Qnil);
+ init_kboard (current_kboard, Qnil);
if (!noninteractive)
{
variable are `sigusr1' and `sigusr2'. */);
Vdebug_on_event = intern_c_string ("sigusr2");
- /* Create the initial keyboard. */
- initial_kboard = xmalloc (sizeof *initial_kboard);
- init_kboard (initial_kboard);
- /* Vwindow_system is left at t for now. */
- initial_kboard->next_kboard = all_kboards;
- all_kboards = initial_kboard;
+ /* Create the initial keyboard. Qt means 'unset'. */
+ initial_kboard = allocate_kboard (Qt);
}
void
extern bool menu_separator_name_p (const char *);
extern bool parse_menu_item (Lisp_Object, int);
-extern void init_kboard (KBOARD *);
+extern KBOARD *allocate_kboard (Lisp_Object);
extern void delete_kboard (KBOARD *);
extern void not_single_kboard_state (KBOARD *);
extern void push_kboard (struct kboard *);
ns_initialize_display_info (dpyinfo);
terminal = ns_create_terminal (dpyinfo);
- terminal->kboard = xmalloc (sizeof *terminal->kboard);
- init_kboard (terminal->kboard);
- kset_window_system (terminal->kboard, Qns);
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
+ terminal->kboard = allocate_kboard (Qns);
/* Don't let the initial kboard remain current longer than necessary.
That would cause problems if a file loaded on startup tries to
prompt in the mini-buffer. */
tty->mouse_highlight.mouse_face_window = Qnil;
#endif
- terminal->kboard = xmalloc (sizeof *terminal->kboard);
- init_kboard (terminal->kboard);
- kset_window_system (terminal->kboard, Qnil);
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
+ terminal->kboard = allocate_kboard (Qnil);
terminal->kboard->reference_count++;
/* Don't let the initial kboard remain current longer than necessary.
That would cause problems if a file loaded on startup tries to
/* We don't yet support separate terminals on W32, so don't try to share
keyboards between virtual terminals that are on the same physical
terminal like X does. */
- terminal->kboard = xmalloc (sizeof (KBOARD));
- init_kboard (terminal->kboard);
- kset_window_system (terminal->kboard, Qw32);
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
+ terminal->kboard = allocate_kboard (Qw32);
/* Don't let the initial kboard remain current longer than necessary.
That would cause problems if a file loaded on startup tries to
prompt in the mini-buffer. */
terminal->kboard = share->terminal->kboard;
else
{
- terminal->kboard = xmalloc (sizeof *terminal->kboard);
- init_kboard (terminal->kboard);
- kset_window_system (terminal->kboard, Qx);
-
- /* Add the keyboard to the list before running Lisp code (via
- Qvendor_specific_keysyms below), since these are not traced
- via terminals but only through all_kboards. */
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
+ terminal->kboard = allocate_kboard (Qx);
if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
{