Mercurial > emacs
comparison src/frame.c @ 42743:1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
frames.
(do_switch_frame): For termcap frames, switch the tty
color mode as specified by the frame's parameters.
(Qtty_color_mode): New variable.
(syms_of_frame): Intern and staticpro it.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 14 Jan 2002 13:47:02 +0000 |
parents | 0ef9924a634f |
children | 512ab477b395 |
comparison
equal
deleted
inserted
replaced
42742:73fcf65b58d3 | 42743:1e6231c9c359 |
---|---|
72 Lisp_Object Qdisplay_type; | 72 Lisp_Object Qdisplay_type; |
73 Lisp_Object Qbackground_mode; | 73 Lisp_Object Qbackground_mode; |
74 Lisp_Object Qinhibit_default_face_x_resources; | 74 Lisp_Object Qinhibit_default_face_x_resources; |
75 Lisp_Object Qleft_fringe; | 75 Lisp_Object Qleft_fringe; |
76 Lisp_Object Qright_fringe; | 76 Lisp_Object Qright_fringe; |
77 Lisp_Object Qtty_color_mode; | |
77 | 78 |
78 Lisp_Object Vterminal_frame; | 79 Lisp_Object Vterminal_frame; |
79 Lisp_Object Vdefault_frame_alist; | 80 Lisp_Object Vdefault_frame_alist; |
80 Lisp_Object Vmouse_position_function; | 81 Lisp_Object Vmouse_position_function; |
81 | 82 |
639 if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) | 640 if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) |
640 last_nonminibuf_frame = XFRAME (selected_frame); | 641 last_nonminibuf_frame = XFRAME (selected_frame); |
641 | 642 |
642 Fselect_window (XFRAME (frame)->selected_window); | 643 Fselect_window (XFRAME (frame)->selected_window); |
643 | 644 |
645 #ifndef WINDOWSNT | |
646 /* Make sure to switch the tty color mode to that of the newly | |
647 selected frame. */ | |
648 sf = SELECTED_FRAME (); | |
649 if (FRAME_TERMCAP_P (sf)) | |
650 { | |
651 Lisp_Object color_mode_spec, color_mode; | |
652 | |
653 color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist); | |
654 if (CONSP (color_mode_spec)) | |
655 color_mode = XCDR (color_mode_spec); | |
656 else | |
657 color_mode = make_number (0); | |
658 set_tty_color_mode (sf, color_mode); | |
659 } | |
660 #endif /* !WINDOWSNT */ | |
661 | |
644 /* We want to make sure that the next event generates a frame-switch | 662 /* We want to make sure that the next event generates a frame-switch |
645 event to the appropriate frame. This seems kludgy to me, but | 663 event to the appropriate frame. This seems kludgy to me, but |
646 before you take it out, make sure that evaluating something like | 664 before you take it out, make sure that evaluating something like |
647 (select-window (frame-root-window (new-frame))) doesn't end up | 665 (select-window (frame-root-window (new-frame))) doesn't end up |
648 with your typing being interpreted in the new frame instead of | 666 with your typing being interpreted in the new frame instead of |
1923 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | 1941 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
1924 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame | 1942 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame |
1925 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) | 1943 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) |
1926 swap_in_global_binding (prop); | 1944 swap_in_global_binding (prop); |
1927 } | 1945 } |
1946 | |
1947 #ifndef WINDOWSNT | |
1948 /* The tty color mode needs to be set before the frame's parameter | |
1949 alist is updated with the new value, because set_tty_color_mode | |
1950 wants to look at the old mode. */ | |
1951 if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode)) | |
1952 set_tty_color_mode (f, val); | |
1953 #endif | |
1928 | 1954 |
1929 /* Update the frame parameter alist. */ | 1955 /* Update the frame parameter alist. */ |
1930 old_alist_elt = Fassq (prop, f->param_alist); | 1956 old_alist_elt = Fassq (prop, f->param_alist); |
1931 if (EQ (old_alist_elt, Qnil)) | 1957 if (EQ (old_alist_elt, Qnil)) |
1932 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); | 1958 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
2472 staticpro (&Qbackground_mode); | 2498 staticpro (&Qbackground_mode); |
2473 Qleft_fringe = intern ("left-fringe"); | 2499 Qleft_fringe = intern ("left-fringe"); |
2474 staticpro (&Qleft_fringe); | 2500 staticpro (&Qleft_fringe); |
2475 Qright_fringe = intern ("right-fringe"); | 2501 Qright_fringe = intern ("right-fringe"); |
2476 staticpro (&Qright_fringe); | 2502 staticpro (&Qright_fringe); |
2503 Qtty_color_mode = intern ("tty-color-mode"); | |
2504 staticpro (&Qtty_color_mode); | |
2477 | 2505 |
2478 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, | 2506 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
2479 doc: /* Alist of default values for frame creation. | 2507 doc: /* Alist of default values for frame creation. |
2480 These may be set in your init file, like this: | 2508 These may be set in your init file, like this: |
2481 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)) | 2509 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)) |