else
return Qnil;
}
-
-/* Function to translate colour names to integers. See lisp/term/pc-win.el
- for its definition. */
-
-Lisp_Object Qmsdos_color_translate;
#endif
"lightred", "lightmagenta", "yellow", "white"
};
+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
standard names. For anything more sophisticated, like matching
"gray" with "grey" or translating X color names into their MSDOS
- equivalents, call the Lisp function Qmsdos_color_translate (defined
- on lisp/term/pc-win.el). */
+ equivalents, call the Lisp function Qtty_color_desc (defined
+ on lisp/term/tty-colors.el). */
int
msdos_stdcolor_idx (const char *name)
{
if (strcasecmp (name, vga_colors[i]) == 0)
return i;
- return FACE_TTY_DEFAULT_COLOR;
+ return
+ strcmp (name, unspecified_fg) == 0 ? FACE_TTY_DEFAULT_FG_COLOR
+ : strcmp (name, unspecified_bg) == 0 ? FACE_TTY_DEFAULT_BG_COLOR
+ : FACE_TTY_DEFAULT_COLOR;
}
/* Given a color index, return its standard name. */
-char *
+Lisp_Object
msdos_stdcolor_name (int idx)
{
- if (idx < 0 || idx >= sizeof (vga_colors) / sizeof (vga_colors[0]))
- return ""; /* meaning the default */
- return 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
defsubr (&Smsdos_mouse_disable);
#ifndef HAVE_X_WINDOWS
defsubr (&Smsdos_mouse_p);
- Qmsdos_color_translate = intern ("msdos-color-translate");
- staticpro (&Qmsdos_color_translate);
#endif
DEFVAR_INT ("dos-country-code", &dos_country_code,