changeset 85614:9f3a25157e4f

Make `window-system' into a keyboard-local variable (rather than frame-local as done originally by multi-tty). * startup.el (window-system): Remove. Don't make it frame-local. * keyboard.h (struct kboard): Add Vwindow_system. * keyboard.c (init_kboard): Set a default for Vwindow_system. (mark_kboards): Mark Vwindow_system. * dispnew.c (syms_of_display) <window-system>: Declare terminal-local. (init_display): Don't set the obsolete `window-system' frame-param. * xterm.c (x_term_init): * w32term.c (w32_create_terminal): * term.c (init_tty): Set Vwindow_system. * macterm.c (mac_create_terminal): Set a keyboard (missing piece of the multi-tty merge maybe?), copied from w32term.c. Set Vwindow_system. * xfns.c (Fx_create_frame, x_create_tip_frame): * w32fns.c (Fx_create_frame, x_create_tip_frame): * macfns.c (Fx_create_frame): Don't set the obsolete `window-system' frame-param. * frame.h (Qwindow_system): Remove. * frame.c (Qwindow_system): Remove. In `syms_of_frame' as well. (Fmake_terminal_frame): Don't set obsolete `window-system' frame-param.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 25 Oct 2007 02:38:41 +0000
parents ae9da278f53b
children 991e2f962164
files lisp/ChangeLog lisp/startup.el src/ChangeLog src/dispnew.c src/frame.c src/frame.h src/keyboard.c src/keyboard.h src/macfns.c src/macterm.c src/term.c src/w32fns.c src/w32term.c src/xfns.c src/xterm.c
diffstat 15 files changed, 67 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Oct 24 15:50:28 2007 +0000
+++ b/lisp/ChangeLog	Thu Oct 25 02:38:41 2007 +0000
@@ -1,3 +1,7 @@
+2007-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* startup.el (window-system): Remove.  Don't make it frame-local.
+
 2007-10-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* textmodes/org-publish.el (org-publish-attachment): Re-install
--- a/lisp/startup.el	Wed Oct 24 15:50:28 2007 +0000
+++ b/lisp/startup.el	Thu Oct 25 02:38:41 2007 +0000
@@ -36,13 +36,6 @@
 (defvar command-line-processed nil
   "Non-nil once command line has been processed.")
 
-(defvar window-system initial-window-system
-  "Name of window system the selected frame is displaying through.
-The value is a symbol--for instance, `x' for X windows.
-The value is nil if the selected frame is on a text-only-terminal.")
-
-(make-variable-frame-local 'window-system)
-
 (defgroup initialization nil
   "Emacs start-up procedure."
   :group 'environment)
--- a/src/ChangeLog	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/ChangeLog	Thu Oct 25 02:38:41 2007 +0000
@@ -1,3 +1,30 @@
+2007-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Make `window-system' into a keyboard-local variable (rather than
+	frame-local as done originally by multi-tty).
+
+	* keyboard.h (struct kboard): Add Vwindow_system.
+	* keyboard.c (init_kboard): Set a default for Vwindow_system.
+	(mark_kboards): Mark Vwindow_system.
+
+	* dispnew.c (syms_of_display) <window-system>: Declare terminal-local.
+	(init_display): Don't set the obsolete `window-system' frame-param.
+
+	* xterm.c (x_term_init):
+	* w32term.c (w32_create_terminal):
+	* term.c (init_tty): Set Vwindow_system.
+	* macterm.c (mac_create_terminal): Set a keyboard (missing piece of the
+	multi-tty merge maybe?), copied from w32term.c.  Set Vwindow_system.
+
+	* xfns.c (Fx_create_frame, x_create_tip_frame):
+	* w32fns.c (Fx_create_frame, x_create_tip_frame):
+	* macfns.c (Fx_create_frame):
+	Don't set the obsolete `window-system' frame-param.
+
+	* frame.h (Qwindow_system): Remove.
+	* frame.c (Qwindow_system): Remove.  In `syms_of_frame' as well.
+	(Fmake_terminal_frame): Don't set obsolete `window-system' frame-param.
+
 2007-10-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* process.c (unwind_request_sigio): Only define if __ultrix__.
--- a/src/dispnew.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/dispnew.c	Thu Oct 25 02:38:41 2007 +0000
@@ -6956,7 +6956,6 @@
       (*initial_terminal->delete_terminal_hook) (initial_terminal);
 
     /* Update frame parameters to reflect the new type. */
-    Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
     Fmodify_frame_parameters
       (selected_frame, Fcons (Fcons (Qtty_type,
                                      Ftty_type (selected_frame)), Qnil));
@@ -7106,6 +7105,11 @@
 The value is a symbol--for instance, `x' for X windows.
 The value is nil if Emacs is using a text-only terminal.  */);
 
+  DEFVAR_KBOARD ("window-system", Vwindow_system,
+		 doc: /* Name of window system through which the selected frame is displayed.
+The value is a symbol--for instance, `x' for X windows.
+The value is nil if the selected frame is on a text-only-terminal.  */);
+
   DEFVAR_LISP ("window-system-version", &Vwindow_system_version,
 	       doc: /* The version number of the window system in use.
 For X windows, this is 10 or 11.  */);
--- a/src/frame.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/frame.c	Thu Oct 25 02:38:41 2007 +0000
@@ -110,7 +110,6 @@
 Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
 Lisp_Object Qtty_color_mode;
 Lisp_Object Qtty, Qtty_type;
-Lisp_Object Qwindow_system;
 
 Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
 
@@ -520,6 +519,7 @@
     {
       initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
       init_kboard (initial_kboard);
+      /* Leave Vwindow_system at its `t' default for now.  */
       initial_kboard->next_kboard = all_kboards;
       all_kboards = initial_kboard;
     }
@@ -764,7 +764,6 @@
   XSETFRAME (frame, f);
   Fmodify_frame_parameters (frame, Vdefault_frame_alist);
   Fmodify_frame_parameters (frame, parms);
-  Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
   Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
                                                  build_string (t->display_info.tty->type)),
                                           Qnil));
@@ -4292,8 +4291,6 @@
   staticpro (&Qtty);
   Qtty_type = intern ("tty-type");
   staticpro (&Qtty_type);
-  Qwindow_system = intern ("window-system");
-  staticpro (&Qwindow_system);
 
   Qface_set_after_frame_default = intern ("face-set-after-frame-default");
   staticpro (&Qface_set_after_frame_default);
--- a/src/frame.h	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/frame.h	Thu Oct 25 02:38:41 2007 +0000
@@ -1020,8 +1020,6 @@
 extern Lisp_Object Qleft, Qright, Qtop, Qbox;
 extern Lisp_Object Qdisplay;
 
-extern Lisp_Object Qwindow_system;
-
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* The class of this X application.  */
--- a/src/keyboard.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/keyboard.c	Thu Oct 25 02:38:41 2007 +0000
@@ -11489,6 +11489,7 @@
   kb->reference_count = 0;
   kb->Vsystem_key_alist = Qnil;
   kb->system_key_syms = Qnil;
+  kb->Vwindow_system = Qt;	/* Unset.  */
   kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
   kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
   Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
@@ -11571,6 +11572,7 @@
 #endif
   wipe_kboard (current_kboard);
   init_kboard (current_kboard);
+  /* Leave Vwindow_system at its `t' default for now.  */
 
   if (!noninteractive)
     {
@@ -12466,6 +12468,7 @@
       mark_object (kb->Vlast_kbd_macro);
       mark_object (kb->Vsystem_key_alist);
       mark_object (kb->system_key_syms);
+      mark_object (kb->Vwindow_system);
       mark_object (kb->Vinput_decode_map);
       mark_object (kb->Vlocal_function_key_map);
       mark_object (kb->Vdefault_minibuffer_frame);
--- a/src/keyboard.h	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/keyboard.h	Thu Oct 25 02:38:41 2007 +0000
@@ -80,8 +80,7 @@
        commands that set the prefix argument.  */
     Lisp_Object Vlast_command;
 
-    /* Normally same as last-command, but never modified by
-       other commands.  */
+    /* Normally same as last-command, but never modified by other commands.  */
     Lisp_Object Vreal_last_command;
 
     /* User-supplied table to translate input characters through.  */
@@ -130,6 +129,9 @@
     /* Cache for modify_event_symbol.  */
     Lisp_Object system_key_syms;
 
+    /* The kind of display: x, w32, ...  */
+    Lisp_Object Vwindow_system;
+
     /* Keymap mapping keys to alternative preferred forms.
        See the DEFVAR for more documentation.  */
     Lisp_Object Vlocal_function_key_map;
--- a/src/macfns.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/macfns.c	Thu Oct 25 02:38:41 2007 +0000
@@ -2830,8 +2830,6 @@
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
-  store_frame_param (f, Qwindow_system, Qmac);
-  
   UNGCPRO;
 
   /* Make sure windows on this frame appear in calls to next-window
--- a/src/macterm.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/macterm.c	Thu Oct 25 02:38:41 2007 +0000
@@ -12821,6 +12821,26 @@
 
 #endif
 
+  /* FIXME: This keyboard setup is 100% untested, just copied from
+     w32_create_terminal in order to set window-system now that it's
+     a keyboard object.  */
+#ifdef MULTI_KBOARD
+  /* We don't yet support separate terminals on Mac, so don't try to share
+     keyboards between virtual terminals that are on the same physical
+     terminal like X does.  */
+  terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+  init_kboard (terminal->kboard);
+  terminal->kboard->Vwindow_system = intern ("mac");
+  terminal->kboard->next_kboard = all_kboards;
+  all_kboards = terminal->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 mini-buffer.  */
+  if (current_kboard == initial_kboard)
+    current_kboard = terminal->kboard;
+  terminal->kboard->reference_count++;
+#endif
+
   return terminal;
 }
 
--- a/src/term.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/term.c	Thu Oct 25 02:38:41 2007 +0000
@@ -3487,6 +3487,7 @@
 #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++;
--- a/src/w32fns.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/w32fns.c	Thu Oct 25 02:38:41 2007 +0000
@@ -4455,8 +4455,6 @@
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
-  store_frame_param (f, Qwindow_system, Qw32);
-  
   UNGCPRO;
 
   /* Make sure windows on this frame appear in calls to next-window
@@ -7439,8 +7437,6 @@
 					      Qnil));
   }
 
-  Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qw32), Qnil));
-
   f->no_split = 1;
 
   UNGCPRO;
--- a/src/w32term.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/w32term.c	Thu Oct 25 02:38:41 2007 +0000
@@ -6331,6 +6331,7 @@
      terminal like X does.  */
   terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
   init_kboard (terminal->kboard);
+  terminal->kboard->Vwindow_system = intern ("w32");
   terminal->kboard->next_kboard = all_kboards;
   all_kboards = terminal->kboard;
   /* Don't let the initial kboard remain current longer than necessary.
--- a/src/xfns.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/xfns.c	Thu Oct 25 02:38:41 2007 +0000
@@ -3472,8 +3472,6 @@
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
-  store_frame_param (f, Qwindow_system, Qx);
-
   UNGCPRO;
 
   /* Make sure windows on this frame appear in calls to next-window
@@ -4979,8 +4977,6 @@
 					      Qnil));
   }
 
-  Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil));
-
   f->no_split = 1;
 
   UNGCPRO;
--- a/src/xterm.c	Wed Oct 24 15:50:28 2007 +0000
+++ b/src/xterm.c	Thu Oct 25 02:38:41 2007 +0000
@@ -10781,6 +10781,7 @@
       {
 	terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
 	init_kboard (terminal->kboard);
+	terminal->kboard->Vwindow_system = intern ("x");
 	if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
 	  {
 	    char *vendor = ServerVendor (dpy);