aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2007-10-25 02:38:41 +0000
committerStefan Monnier2007-10-25 02:38:41 +0000
commit70b8d0a4a3042a7da72f6e8999d39b018ca3520a (patch)
tree18fc35f1591c5a08cc223893af158b7b0888958d /src
parent5656d1bfaf6aff3a1d0b783460f0b304de0be900 (diff)
downloademacs-70b8d0a4a3042a7da72f6e8999d39b018ca3520a.tar.gz
emacs-70b8d0a4a3042a7da72f6e8999d39b018ca3520a.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/dispnew.c6
-rw-r--r--src/frame.c5
-rw-r--r--src/frame.h2
-rw-r--r--src/keyboard.c3
-rw-r--r--src/keyboard.h6
-rw-r--r--src/macfns.c2
-rw-r--r--src/macterm.c20
-rw-r--r--src/term.c1
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32term.c1
-rw-r--r--src/xfns.c4
-rw-r--r--src/xterm.c1
13 files changed, 63 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c137d23acfb..5785c3df247 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
12007-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 Make `window-system' into a keyboard-local variable (rather than
4 frame-local as done originally by multi-tty).
5
6 * keyboard.h (struct kboard): Add Vwindow_system.
7 * keyboard.c (init_kboard): Set a default for Vwindow_system.
8 (mark_kboards): Mark Vwindow_system.
9
10 * dispnew.c (syms_of_display) <window-system>: Declare terminal-local.
11 (init_display): Don't set the obsolete `window-system' frame-param.
12
13 * xterm.c (x_term_init):
14 * w32term.c (w32_create_terminal):
15 * term.c (init_tty): Set Vwindow_system.
16 * macterm.c (mac_create_terminal): Set a keyboard (missing piece of the
17 multi-tty merge maybe?), copied from w32term.c. Set Vwindow_system.
18
19 * xfns.c (Fx_create_frame, x_create_tip_frame):
20 * w32fns.c (Fx_create_frame, x_create_tip_frame):
21 * macfns.c (Fx_create_frame):
22 Don't set the obsolete `window-system' frame-param.
23
24 * frame.h (Qwindow_system): Remove.
25 * frame.c (Qwindow_system): Remove. In `syms_of_frame' as well.
26 (Fmake_terminal_frame): Don't set obsolete `window-system' frame-param.
27
12007-10-23 Stefan Monnier <monnier@iro.umontreal.ca> 282007-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 29
3 * process.c (unwind_request_sigio): Only define if __ultrix__. 30 * process.c (unwind_request_sigio): Only define if __ultrix__.
diff --git a/src/dispnew.c b/src/dispnew.c
index 1778d5c818b..ad139681d54 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6956,7 +6956,6 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
6956 (*initial_terminal->delete_terminal_hook) (initial_terminal); 6956 (*initial_terminal->delete_terminal_hook) (initial_terminal);
6957 6957
6958 /* Update frame parameters to reflect the new type. */ 6958 /* Update frame parameters to reflect the new type. */
6959 Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
6960 Fmodify_frame_parameters 6959 Fmodify_frame_parameters
6961 (selected_frame, Fcons (Fcons (Qtty_type, 6960 (selected_frame, Fcons (Fcons (Qtty_type,
6962 Ftty_type (selected_frame)), Qnil)); 6961 Ftty_type (selected_frame)), Qnil));
@@ -7106,6 +7105,11 @@ It is up to you to set this variable if your terminal can do that. */);
7106The value is a symbol--for instance, `x' for X windows. 7105The value is a symbol--for instance, `x' for X windows.
7107The value is nil if Emacs is using a text-only terminal. */); 7106The value is nil if Emacs is using a text-only terminal. */);
7108 7107
7108 DEFVAR_KBOARD ("window-system", Vwindow_system,
7109 doc: /* Name of window system through which the selected frame is displayed.
7110The value is a symbol--for instance, `x' for X windows.
7111The value is nil if the selected frame is on a text-only-terminal. */);
7112
7109 DEFVAR_LISP ("window-system-version", &Vwindow_system_version, 7113 DEFVAR_LISP ("window-system-version", &Vwindow_system_version,
7110 doc: /* The version number of the window system in use. 7114 doc: /* The version number of the window system in use.
7111For X windows, this is 10 or 11. */); 7115For X windows, this is 10 or 11. */);
diff --git a/src/frame.c b/src/frame.c
index 090de96cebd..ab778ae084a 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -110,7 +110,6 @@ Lisp_Object Qleft_fringe, Qright_fringe;
110Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; 110Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
111Lisp_Object Qtty_color_mode; 111Lisp_Object Qtty_color_mode;
112Lisp_Object Qtty, Qtty_type; 112Lisp_Object Qtty, Qtty_type;
113Lisp_Object Qwindow_system;
114 113
115Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; 114Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
116 115
@@ -520,6 +519,7 @@ make_initial_frame (void)
520 { 519 {
521 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 520 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
522 init_kboard (initial_kboard); 521 init_kboard (initial_kboard);
522 /* Leave Vwindow_system at its `t' default for now. */
523 initial_kboard->next_kboard = all_kboards; 523 initial_kboard->next_kboard = all_kboards;
524 all_kboards = initial_kboard; 524 all_kboards = initial_kboard;
525 } 525 }
@@ -764,7 +764,6 @@ affects all frames on the same terminal device. */)
764 XSETFRAME (frame, f); 764 XSETFRAME (frame, f);
765 Fmodify_frame_parameters (frame, Vdefault_frame_alist); 765 Fmodify_frame_parameters (frame, Vdefault_frame_alist);
766 Fmodify_frame_parameters (frame, parms); 766 Fmodify_frame_parameters (frame, parms);
767 Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
768 Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type, 767 Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
769 build_string (t->display_info.tty->type)), 768 build_string (t->display_info.tty->type)),
770 Qnil)); 769 Qnil));
@@ -4292,8 +4291,6 @@ syms_of_frame ()
4292 staticpro (&Qtty); 4291 staticpro (&Qtty);
4293 Qtty_type = intern ("tty-type"); 4292 Qtty_type = intern ("tty-type");
4294 staticpro (&Qtty_type); 4293 staticpro (&Qtty_type);
4295 Qwindow_system = intern ("window-system");
4296 staticpro (&Qwindow_system);
4297 4294
4298 Qface_set_after_frame_default = intern ("face-set-after-frame-default"); 4295 Qface_set_after_frame_default = intern ("face-set-after-frame-default");
4299 staticpro (&Qface_set_after_frame_default); 4296 staticpro (&Qface_set_after_frame_default);
diff --git a/src/frame.h b/src/frame.h
index d76cc15402a..539b0b7edd0 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1020,8 +1020,6 @@ extern Lisp_Object Qx_resource_name;
1020extern Lisp_Object Qleft, Qright, Qtop, Qbox; 1020extern Lisp_Object Qleft, Qright, Qtop, Qbox;
1021extern Lisp_Object Qdisplay; 1021extern Lisp_Object Qdisplay;
1022 1022
1023extern Lisp_Object Qwindow_system;
1024
1025#ifdef HAVE_WINDOW_SYSTEM 1023#ifdef HAVE_WINDOW_SYSTEM
1026 1024
1027/* The class of this X application. */ 1025/* The class of this X application. */
diff --git a/src/keyboard.c b/src/keyboard.c
index 527cc9c6338..cc6b46a6ba4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11489,6 +11489,7 @@ init_kboard (kb)
11489 kb->reference_count = 0; 11489 kb->reference_count = 0;
11490 kb->Vsystem_key_alist = Qnil; 11490 kb->Vsystem_key_alist = Qnil;
11491 kb->system_key_syms = Qnil; 11491 kb->system_key_syms = Qnil;
11492 kb->Vwindow_system = Qt; /* Unset. */
11492 kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil); 11493 kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
11493 kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); 11494 kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
11494 Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map); 11495 Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
@@ -11571,6 +11572,7 @@ init_keyboard ()
11571#endif 11572#endif
11572 wipe_kboard (current_kboard); 11573 wipe_kboard (current_kboard);
11573 init_kboard (current_kboard); 11574 init_kboard (current_kboard);
11575 /* Leave Vwindow_system at its `t' default for now. */
11574 11576
11575 if (!noninteractive) 11577 if (!noninteractive)
11576 { 11578 {
@@ -12466,6 +12468,7 @@ mark_kboards ()
12466 mark_object (kb->Vlast_kbd_macro); 12468 mark_object (kb->Vlast_kbd_macro);
12467 mark_object (kb->Vsystem_key_alist); 12469 mark_object (kb->Vsystem_key_alist);
12468 mark_object (kb->system_key_syms); 12470 mark_object (kb->system_key_syms);
12471 mark_object (kb->Vwindow_system);
12469 mark_object (kb->Vinput_decode_map); 12472 mark_object (kb->Vinput_decode_map);
12470 mark_object (kb->Vlocal_function_key_map); 12473 mark_object (kb->Vlocal_function_key_map);
12471 mark_object (kb->Vdefault_minibuffer_frame); 12474 mark_object (kb->Vdefault_minibuffer_frame);
diff --git a/src/keyboard.h b/src/keyboard.h
index ae135b30b77..6d046bc98e7 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -80,8 +80,7 @@ struct kboard
80 commands that set the prefix argument. */ 80 commands that set the prefix argument. */
81 Lisp_Object Vlast_command; 81 Lisp_Object Vlast_command;
82 82
83 /* Normally same as last-command, but never modified by 83 /* Normally same as last-command, but never modified by other commands. */
84 other commands. */
85 Lisp_Object Vreal_last_command; 84 Lisp_Object Vreal_last_command;
86 85
87 /* User-supplied table to translate input characters through. */ 86 /* User-supplied table to translate input characters through. */
@@ -130,6 +129,9 @@ struct kboard
130 /* Cache for modify_event_symbol. */ 129 /* Cache for modify_event_symbol. */
131 Lisp_Object system_key_syms; 130 Lisp_Object system_key_syms;
132 131
132 /* The kind of display: x, w32, ... */
133 Lisp_Object Vwindow_system;
134
133 /* Keymap mapping keys to alternative preferred forms. 135 /* Keymap mapping keys to alternative preferred forms.
134 See the DEFVAR for more documentation. */ 136 See the DEFVAR for more documentation. */
135 Lisp_Object Vlocal_function_key_map; 137 Lisp_Object Vlocal_function_key_map;
diff --git a/src/macfns.c b/src/macfns.c
index d0b859054a6..56ef81c9701 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2830,8 +2830,6 @@ This function is an internal primitive--use `make-frame' instead. */)
2830 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 2830 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
2831 f->param_alist = Fcons (XCAR (tem), f->param_alist); 2831 f->param_alist = Fcons (XCAR (tem), f->param_alist);
2832 2832
2833 store_frame_param (f, Qwindow_system, Qmac);
2834
2835 UNGCPRO; 2833 UNGCPRO;
2836 2834
2837 /* Make sure windows on this frame appear in calls to next-window 2835 /* Make sure windows on this frame appear in calls to next-window
diff --git a/src/macterm.c b/src/macterm.c
index ef1fa7c7453..d015a00e146 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -12821,6 +12821,26 @@ mac_create_terminal (struct mac_display_info *dpyinfo)
12821 12821
12822#endif 12822#endif
12823 12823
12824 /* FIXME: This keyboard setup is 100% untested, just copied from
12825 w32_create_terminal in order to set window-system now that it's
12826 a keyboard object. */
12827#ifdef MULTI_KBOARD
12828 /* We don't yet support separate terminals on Mac, so don't try to share
12829 keyboards between virtual terminals that are on the same physical
12830 terminal like X does. */
12831 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
12832 init_kboard (terminal->kboard);
12833 terminal->kboard->Vwindow_system = intern ("mac");
12834 terminal->kboard->next_kboard = all_kboards;
12835 all_kboards = terminal->kboard;
12836 /* Don't let the initial kboard remain current longer than necessary.
12837 That would cause problems if a file loaded on startup tries to
12838 prompt in the mini-buffer. */
12839 if (current_kboard == initial_kboard)
12840 current_kboard = terminal->kboard;
12841 terminal->kboard->reference_count++;
12842#endif
12843
12824 return terminal; 12844 return terminal;
12825} 12845}
12826 12846
diff --git a/src/term.c b/src/term.c
index b97e77b2320..cdf84eef091 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3487,6 +3487,7 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
3487#ifdef MULTI_KBOARD 3487#ifdef MULTI_KBOARD
3488 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 3488 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
3489 init_kboard (terminal->kboard); 3489 init_kboard (terminal->kboard);
3490 terminal->kboard->Vwindow_system = Qnil;
3490 terminal->kboard->next_kboard = all_kboards; 3491 terminal->kboard->next_kboard = all_kboards;
3491 all_kboards = terminal->kboard; 3492 all_kboards = terminal->kboard;
3492 terminal->kboard->reference_count++; 3493 terminal->kboard->reference_count++;
diff --git a/src/w32fns.c b/src/w32fns.c
index bc088a3d4f5..e5c730a528c 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4455,8 +4455,6 @@ This function is an internal primitive--use `make-frame' instead. */)
4455 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 4455 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
4456 f->param_alist = Fcons (XCAR (tem), f->param_alist); 4456 f->param_alist = Fcons (XCAR (tem), f->param_alist);
4457 4457
4458 store_frame_param (f, Qwindow_system, Qw32);
4459
4460 UNGCPRO; 4458 UNGCPRO;
4461 4459
4462 /* Make sure windows on this frame appear in calls to next-window 4460 /* Make sure windows on this frame appear in calls to next-window
@@ -7439,8 +7437,6 @@ x_create_tip_frame (dpyinfo, parms, text)
7439 Qnil)); 7437 Qnil));
7440 } 7438 }
7441 7439
7442 Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qw32), Qnil));
7443
7444 f->no_split = 1; 7440 f->no_split = 1;
7445 7441
7446 UNGCPRO; 7442 UNGCPRO;
diff --git a/src/w32term.c b/src/w32term.c
index 80ea9983cef..edde95f5f13 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6331,6 +6331,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6331 terminal like X does. */ 6331 terminal like X does. */
6332 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 6332 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
6333 init_kboard (terminal->kboard); 6333 init_kboard (terminal->kboard);
6334 terminal->kboard->Vwindow_system = intern ("w32");
6334 terminal->kboard->next_kboard = all_kboards; 6335 terminal->kboard->next_kboard = all_kboards;
6335 all_kboards = terminal->kboard; 6336 all_kboards = terminal->kboard;
6336 /* Don't let the initial kboard remain current longer than necessary. 6337 /* Don't let the initial kboard remain current longer than necessary.
diff --git a/src/xfns.c b/src/xfns.c
index 43ed2f75514..4492064622a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3472,8 +3472,6 @@ This function is an internal primitive--use `make-frame' instead. */)
3472 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 3472 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
3473 f->param_alist = Fcons (XCAR (tem), f->param_alist); 3473 f->param_alist = Fcons (XCAR (tem), f->param_alist);
3474 3474
3475 store_frame_param (f, Qwindow_system, Qx);
3476
3477 UNGCPRO; 3475 UNGCPRO;
3478 3476
3479 /* Make sure windows on this frame appear in calls to next-window 3477 /* Make sure windows on this frame appear in calls to next-window
@@ -4979,8 +4977,6 @@ x_create_tip_frame (dpyinfo, parms, text)
4979 Qnil)); 4977 Qnil));
4980 } 4978 }
4981 4979
4982 Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil));
4983
4984 f->no_split = 1; 4980 f->no_split = 1;
4985 4981
4986 UNGCPRO; 4982 UNGCPRO;
diff --git a/src/xterm.c b/src/xterm.c
index 29c840ff799..f4bead6080c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10781,6 +10781,7 @@ x_term_init (display_name, xrm_option, resource_name)
10781 { 10781 {
10782 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 10782 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
10783 init_kboard (terminal->kboard); 10783 init_kboard (terminal->kboard);
10784 terminal->kboard->Vwindow_system = intern ("x");
10784 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) 10785 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
10785 { 10786 {
10786 char *vendor = ServerVendor (dpy); 10787 char *vendor = ServerVendor (dpy);