aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2002-01-14 13:47:02 +0000
committerEli Zaretskii2002-01-14 13:47:02 +0000
commit94674d18e6ff1ec007bd0d0bbfce2d6584d25d0b (patch)
treebb15fed8b3324cb0b962a5203fd036ebcfdbf5ae /src
parentace282979b07417322cc9f85426a13944ae27631 (diff)
downloademacs-94674d18e6ff1ec007bd0d0bbfce2d6584d25d0b.tar.gz
emacs-94674d18e6ff1ec007bd0d0bbfce2d6584d25d0b.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index d6154b7ab04..93c68388513 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -74,6 +74,7 @@ Lisp_Object Qbackground_mode;
74Lisp_Object Qinhibit_default_face_x_resources; 74Lisp_Object Qinhibit_default_face_x_resources;
75Lisp_Object Qleft_fringe; 75Lisp_Object Qleft_fringe;
76Lisp_Object Qright_fringe; 76Lisp_Object Qright_fringe;
77Lisp_Object Qtty_color_mode;
77 78
78Lisp_Object Vterminal_frame; 79Lisp_Object Vterminal_frame;
79Lisp_Object Vdefault_frame_alist; 80Lisp_Object Vdefault_frame_alist;
@@ -641,6 +642,23 @@ do_switch_frame (frame, track, for_deletion)
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
@@ -1926,6 +1944,14 @@ store_frame_param (f, prop, val)
1926 swap_in_global_binding (prop); 1944 swap_in_global_binding (prop);
1927 } 1945 }
1928 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
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))
@@ -2474,6 +2500,8 @@ syms_of_frame ()
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.