# HG changeset patch # User Karoly Lorentey # Date 1126135734 0 # Node ID c3dd82172ed1fa9185bc4adb79925ff2d3768c52 # Parent 39de99cd3f0860c18353a457ff87ab9f1e0887ca Enforce the presence of `window-system' and `tty-type' frame parameters in all frames. * src/dispnew.c (init_display): Set up `window-system' and `tty-type' frame parameters in the initial tty frame. * src/frame.c (Fmake_terminal_frame): Look up the `tty-type' frame parameter, not `tty' when discovering the tty type of the new frame. Initialize `tty' and `tty-type' frame parameters in the new frame. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-402 diff -r 39de99cd3f08 -r c3dd82172ed1 README.multi-tty --- a/README.multi-tty Wed Sep 07 23:17:07 2005 +0000 +++ b/README.multi-tty Wed Sep 07 23:28:54 2005 +0000 @@ -398,13 +398,17 @@ > The reason is that terminal-init-xterm calls > xterm-register-default-colors which calls (display-color-cells (selected-frame)) > and probably `selected-frame' is not completely setup at that time. - + ** emacsclient --no-wait and --eval is currently broken. ** xt-mouse.el needs to be adapted for multi-tty. It currently signals an error on kill-emacs under X, which prevents the user from exiting Emacs. (Reported by Mnemonikk on freenode.) +** Consider the `tty-type' frame parameter and the `display-tty-type' + function. They serve the exact same purpose. I think it may be + a good idea to eliminate one of them, preferably `tty-type'. + ** The handling of lisp/term/*.el, and frame creation in general, is a big, big mess. How come the terminal-specific file is loaded by tty-create-frame-with-faces? I don't think it is necessary to load @@ -1213,6 +1217,7 @@ frame is selected. (Done.) + ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d diff -r 39de99cd3f08 -r c3dd82172ed1 src/dispnew.c --- a/src/dispnew.c Wed Sep 07 23:17:07 2005 +0000 +++ b/src/dispnew.c Wed Sep 07 23:28:54 2005 +0000 @@ -6776,7 +6776,9 @@ d->reference_count++; d->display_info.tty->top_frame = selected_frame; - change_frame_size (XFRAME (selected_frame), FrameRows (d->display_info.tty), FrameCols (d->display_info.tty), 0, 0, 1); + change_frame_size (XFRAME (selected_frame), + FrameRows (d->display_info.tty), + FrameCols (d->display_info.tty), 0, 0, 1); /* Delete the initial display. */ if (--initial_device->reference_count == 0 @@ -6784,9 +6786,11 @@ (*initial_device->delete_device_hook) (initial_device); /* 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, Fdisplay_tty_type (selected_frame)), Qnil)); + Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil)); } { diff -r 39de99cd3f08 -r c3dd82172ed1 src/frame.c --- a/src/frame.c Wed Sep 07 23:17:07 2005 +0000 +++ b/src/frame.c Wed Sep 07 23:28:54 2005 +0000 @@ -661,6 +661,8 @@ struct device *d = NULL; Lisp_Object frame, tem; struct frame *sf = SELECTED_FRAME (); + Lisp_Object tty, tty_type; + struct gcpro gcpro1, gcpro2; #ifdef MSDOS if (sf->output_method != output_msdos_raw @@ -693,7 +695,6 @@ if (!d) { - Lisp_Object tty, tty_type; char *name = 0, *type = 0; tty = Fassq (Qtty, parms); @@ -711,7 +712,7 @@ tty_type = Fassq (Qtty_type, parms); if (EQ (tty_type, Qnil)) - tty_type = Fassq (Qtty, XFRAME (selected_frame)->param_alist); + tty_type = Fassq (Qtty_type, XFRAME (selected_frame)->param_alist); if (EQ (tty_type, Qnil) && FRAME_TERMCAP_P (XFRAME (selected_frame)) && FRAME_TTY (XFRAME (selected_frame))->type) tty_type = build_string (FRAME_TTY (XFRAME (selected_frame))->type); @@ -750,10 +751,14 @@ adjust_glyphs (f); calculate_costs (f); XSETFRAME (frame, f); + GCPRO2 (tty_type, tty); 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, tty_type), Qnil)); + Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, tty), Qnil)); + UNGCPRO; + /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ f->face_alist = Fcopy_alist (sf->face_alist);