From 70de9f065a0515b43137df5a62a9d4b151c53bdf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 Oct 2000 17:07:51 +0000 Subject: [PATCH] (Fframe_parameters): Fix the change from 2000-10-16: don't override the colors in frame's param_alist, unless they are unspecified. --- src/frame.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/frame.c b/src/frame.c index d495846fcdf..644e7a5347a 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2059,21 +2059,31 @@ If FRAME is omitted, return information on the currently selected frame.") unspecified and reversed, take the frame's background pixel for foreground and vice versa. */ elt = Fassq (Qforeground_color, alist); - if (!NILP (elt) && CONSP (elt) - && STRINGP (XCDR (elt)) - && strncmp (XSTRING (XCDR (elt))->data, - unspecified_bg, - XSTRING (XCDR (elt))->size) == 0) - store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); + if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) + { + if (strncmp (XSTRING (XCDR (elt))->data, + unspecified_bg, + XSTRING (XCDR (elt))->size) == 0) + store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); + else if (strncmp (XSTRING (XCDR (elt))->data, + unspecified_fg, + XSTRING (XCDR (elt))->size) == 0) + store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); + } else store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); elt = Fassq (Qbackground_color, alist); - if (!NILP (elt) && CONSP (elt) - && STRINGP (XCDR (elt)) - && strncmp (XSTRING (XCDR (elt))->data, - unspecified_fg, - XSTRING (XCDR (elt))->size) == 0) - store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); + if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) + { + if (strncmp (XSTRING (XCDR (elt))->data, + unspecified_fg, + XSTRING (XCDR (elt))->size) == 0) + store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); + else if (strncmp (XSTRING (XCDR (elt))->data, + unspecified_bg, + XSTRING (XCDR (elt))->size) == 0) + store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); + } else store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); store_in_alist (&alist, intern ("font"), -- 2.39.5