]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fframe_parameter): For non-windowed frames, if
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2000 18:57:36 +0000 (18:57 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2000 18:57:36 +0000 (18:57 +0000)
f->param_alist says foreground or background color is unspecified,
call tty_color_name to return the color name computed from the
frame's current colors.

src/frame.c

index 6c737eeaefb246a358b450f1cb54121aa31bb2ca..fee69fd5a219f40077df68b76680424472fe4534 100644 (file)
@@ -2133,7 +2133,29 @@ If FRAME is nil, describe the currently selected frame.")
        {
          value = Fassq (parameter, f->param_alist);
          if (CONSP (value))
-           value = XCDR (value);
+           {
+             extern char unspecified_fg[], unspecified_bg[];
+             extern Lisp_Object Qbackground_color, Qforeground_color;
+
+             value = XCDR (value);
+             /* Fframe_parameters puts the actual fg/bg color names,
+                even if f->param_alist says otherwise.  This is
+                important when param_alist's notion of colors is
+                "unspecified".  We need to do the same here.  */
+             if (STRINGP (value) && !FRAME_WINDOW_P (f))
+               {
+                 if (EQ (parameter, Qbackground_color)
+                     && strncmp (XSTRING (value)->data,
+                                 unspecified_bg,
+                                 XSTRING (value)->size) == 0)
+                   value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
+                 else if (EQ (parameter, Qforeground_color)
+                          && strncmp (XSTRING (value)->data,
+                                      unspecified_fg,
+                                      XSTRING (value)->size) == 0)
+                   value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
+               }
+           }
          else if (EQ (parameter, Qdisplay_type)
                   || EQ (parameter, Qbackground_mode))
            /* Avoid consing in frequent cases.  */