Commit 1afcba63 authored by Dmitry Antipov's avatar Dmitry Antipov

* 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.
parent 20832de0
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.
......@@ -29,7 +43,7 @@
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.
......
......@@ -10790,12 +10790,11 @@ The `posn-' functions access elements of such lists. */)
return tem;
}
/*
* 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);
......@@ -10816,13 +10815,27 @@ init_kboard (KBOARD *kb)
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
......@@ -10887,10 +10900,9 @@ init_keyboard (void)
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)
{
......@@ -11695,12 +11707,8 @@ Currently, the only supported values for this
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
......
......@@ -507,7 +507,7 @@ extern unsigned int timers_run;
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 *);
......
......@@ -4169,11 +4169,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
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. */
......
......@@ -4301,11 +4301,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
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
......
......@@ -6262,11 +6262,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
/* 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. */
......
......@@ -9905,15 +9905,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
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))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment