emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/frame.c


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/src/frame.c
Date: Mon, 14 Jan 2002 08:47:02 -0500

Index: emacs/src/frame.c
diff -c emacs/src/frame.c:1.278 emacs/src/frame.c:1.279
*** emacs/src/frame.c:1.278     Fri Nov 30 20:14:55 2001
--- emacs/src/frame.c   Mon Jan 14 08:47:02 2002
***************
*** 74,79 ****
--- 74,80 ----
  Lisp_Object Qinhibit_default_face_x_resources;
  Lisp_Object Qleft_fringe;
  Lisp_Object Qright_fringe;
+ Lisp_Object Qtty_color_mode;
  
  Lisp_Object Vterminal_frame;
  Lisp_Object Vdefault_frame_alist;
***************
*** 641,646 ****
--- 642,664 ----
  
    Fselect_window (XFRAME (frame)->selected_window);
  
+ #ifndef WINDOWSNT
+   /* Make sure to switch the tty color mode to that of the newly
+      selected frame.  */
+   sf = SELECTED_FRAME ();
+   if (FRAME_TERMCAP_P (sf))
+     {
+       Lisp_Object color_mode_spec, color_mode;
+ 
+       color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist);
+       if (CONSP (color_mode_spec))
+       color_mode = XCDR (color_mode_spec);
+       else
+       color_mode = make_number (0);
+       set_tty_color_mode (sf, color_mode);
+     }
+ #endif /* !WINDOWSNT */
+ 
    /* We want to make sure that the next event generates a frame-switch
       event to the appropriate frame.  This seems kludgy to me, but
       before you take it out, make sure that evaluating something like
***************
*** 1926,1931 ****
--- 1944,1957 ----
        swap_in_global_binding (prop);
      }
  
+ #ifndef WINDOWSNT
+   /* The tty color mode needs to be set before the frame's parameter
+      alist is updated with the new value, because set_tty_color_mode
+      wants to look at the old mode.  */
+   if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode))
+     set_tty_color_mode (f, val);
+ #endif
+ 
    /* Update the frame parameter alist.  */
    old_alist_elt = Fassq (prop, f->param_alist);
    if (EQ (old_alist_elt, Qnil))
***************
*** 2474,2479 ****
--- 2500,2507 ----
    staticpro (&Qleft_fringe);
    Qright_fringe = intern ("right-fringe");
    staticpro (&Qright_fringe);
+   Qtty_color_mode = intern ("tty-color-mode");
+   staticpro (&Qtty_color_mode);
  
    DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
               doc: /* Alist of default values for frame creation.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]