+#ifdef MULTI_KBOARD
+ {
+ struct x_display_info *share;
+ Lisp_Object tail;
+
+ for (share = x_display_list, tail = x_display_name_list; share;
+ share = share->next, tail = XCONS (tail)->cdr)
+ if (same_x_server (XSTRING (XCONS (XCONS (tail)->car)->car)->data,
+ XSTRING (display_name)->data))
+ break;
+ if (share)
+ dpyinfo->kboard = share->kboard;
+ else
+ {
+ dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+ init_kboard (dpyinfo->kboard);
+ if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
+ {
+ char *vendor = ServerVendor (dpy);
+ dpyinfo->kboard->Vsystem_key_alist
+ = call1 (Qvendor_specific_keysyms,
+ build_string (vendor ? vendor : ""));
+ }
+
+ dpyinfo->kboard->next_kboard = all_kboards;
+ all_kboards = dpyinfo->kboard;
+ /* 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 minibuffer. */
+ if (current_kboard == initial_kboard)
+ current_kboard = dpyinfo->kboard;
+ }
+ dpyinfo->kboard->reference_count++;
+ }
+#endif
+