From 24480d5b0868b4140b33a1fe2257f52f331f05bf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 3 Jan 2000 16:56:40 +0000 Subject: [PATCH] (unspecified_colors): Remove. (msdos_stdcolor_idx): Use global variables unspecified_fg and unspecified_bg. (msdos_stdcolor_name): Return strings for unspecified fore- and back-ground colors. --- src/ChangeLog | 17 +++++++++++++++++ src/dosfns.c | 28 +++++++++++++--------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 59a6590cbe..37def97ce3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,20 @@ +2000-01-03 Eli Zaretskii + + * dosfns.c (unspecified_colors): Remove. + (msdos_stdcolor_idx): Use global variables unspecified_fg and + unspecified_bg. + (msdos_stdcolor_name): Return strings for unspecified fore- and + back-ground colors. + + * xfaces.c (Qunspecified_fg, Qunspecified_bg): Remove. + (syms_of_xfaces): Remove theit staticpro's. + (tty_color_name): Return Lisp strings for unspecified fore- and + back-ground colors. + (Finternal_set_lisp_face_attribute): Remove the special treatment + for Qunspecified_{f,b}g. + (realize_default_face): Replace Qunspecified_{f,b}g with a Lisp + string. + 2000-01-03 Gerd Moellmann * xdisp.c (reseat_at_next_visible_line_start): Position before diff --git a/src/dosfns.c b/src/dosfns.c index feb9080b7c..3c1fd8f764 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -409,9 +409,7 @@ static char *vga_colors[16] = { "lightred", "lightmagenta", "yellow", "white" }; -static char *unspecified_colors[] = { - "unspecified-fg", "unspecified-bg", "unspecified" -}; +extern char unspecified_fg[], unspecified_bg[]; /* Given a color name, return its index, or -1 if not found. Note that this only performs case-insensitive comparison against the @@ -429,8 +427,8 @@ msdos_stdcolor_idx (const char *name) return i; return - strcmp (name, unspecified_colors[0]) == 0 ? FACE_TTY_DEFAULT_FG_COLOR - : strcmp (name, unspecified_colors[1]) == 0 ? FACE_TTY_DEFAULT_BG_COLOR + strcmp (name, unspecified_fg) == 0 ? FACE_TTY_DEFAULT_FG_COLOR + : strcmp (name, unspecified_bg) == 0 ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_COLOR; } @@ -438,16 +436,16 @@ msdos_stdcolor_idx (const char *name) Lisp_Object msdos_stdcolor_name (int idx) { - extern Lisp_Object Qunspecified, Qunspecified_fg, Qunspecified_bg; - - if (idx < 0 || idx >= sizeof (vga_colors) / sizeof (vga_colors[0])) - { - return - idx == FACE_TTY_DEFAULT_FG_COLOR ? Qunspecified_fg - : idx == FACE_TTY_DEFAULT_BG_COLOR ? Qunspecified_bg - : Qunspecified; /* meaning the default */ - } - return build_string (vga_colors[idx]); + extern Lisp_Object Qunspecified; + + if (idx == FACE_TTY_DEFAULT_FG_COLOR) + return build_string (unspecified_fg); + else if (idx == FACE_TTY_DEFAULT_BG_COLOR) + return build_string (unspecified_bg); + else if (idx >= 0 && idx < sizeof (vga_colors) / sizeof (vga_colors[0])) + return build_string (vga_colors[idx]); + else + return Qunspecified; /* meaning the default */ } /* Support for features that are available when we run in a DOS box -- 2.20.1