Lisp_Object Qx_charset_registry;
+/* The name of the function to call when the background of the frame
+ has changed, frame_update_face_colors. */
+
+Lisp_Object Qframe_update_face_colors;
+
/* Names of basic faces. */
-Lisp_Object Qdefault, Qmodeline, Qtool_bar, Qregion, Qfringe;
+Lisp_Object Qdefault, Qmode_line, Qtool_bar, Qregion, Qfringe;
Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse;;
+/* The symbol `face-alias'. A symbols having that property is an
+ alias for another face. Value of the property is the name of
+ the aliased face. */
+
+Lisp_Object Qface_alias;
+
/* Names of frame parameters related to faces. */
extern Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
/* Remove elements from LIST whose cars are `equal'. Called from
- x-font-list and x-font-family-list to remove duplicate font
+ x-family-fonts and x-font-family-list to remove duplicate font
entries. */
static void
}
-DEFUN ("x-font-list", Fxfont_list, Sx_font_list, 0, 2, 0,
+DEFUN ("x-family-fonts", Fx_family_fonts, Sx_family_fonts, 0, 2, 0,
"Return a list of available fonts of family FAMILY on FRAME.\n\
If FAMILY is omitted or nil, list all families.\n\
Otherwise, FAMILY must be a string, possibly containing wildcards\n\
/* Return the face definition of FACE_NAME on frame F. F null means
return the global definition. FACE_NAME may be a string or a
symbol (apparently Emacs 20.2 allows strings as face names in face
- text properties; ediff uses that). If SIGNAL_P is non-zero, signal
- an error if FACE_NAME is not a valid face name. If SIGNAL_P is
- zero, value is nil if FACE_NAME is not a valid face name. */
+ text properties; ediff uses that). If FACE_NAME is an alias for
+ another face, return that face's definition. If SIGNAL_P is
+ non-zero, signal an error if FACE_NAME is not a valid face name.
+ If SIGNAL_P is zero, value is nil if FACE_NAME is not a valid face
+ name. */
static INLINE Lisp_Object
lface_from_face_name (f, face_name, signal_p)
Lisp_Object face_name;
int signal_p;
{
- Lisp_Object lface;
+ Lisp_Object lface, alias;
if (STRINGP (face_name))
face_name = intern (XSTRING (face_name)->data);
+ /* If FACE_NAME is an alias for another face, return the definition
+ of the aliased face. */
+ alias = Fget (face_name, Qface_alias);
+ if (!NILP (alias))
+ face_name = alias;
+
if (f)
lface = assq_no_quit (face_name, f->face_alist);
else
/* If there are no faces yet, give up. This is the case when called
from Fx_create_frame, and we do the necessary things later in
- face-set-after-frame-defaults. */
+ face-set-after-frame-defaults. */
if (NILP (f->face_alist))
return;
}
else if (EQ (param, Qbackground_color))
{
+ Lisp_Object frame;
+
+ /* Changing the background color might change the background
+ mode, so that we have to load new defface specs. Call
+ frame-update-face-colors to do that. */
+ XSETFRAME (frame, f);
+ call1 (Qframe_update_face_colors, frame);
+
lface = lface_from_face_name (f, Qdefault, 1);
LFACE_BACKGROUND (lface) = (STRINGP (new_value)
? new_value : Qunspecified);
if (realize_default_face (f))
{
- realize_named_face (f, Qmodeline, MODE_LINE_FACE_ID);
+ realize_named_face (f, Qmode_line, MODE_LINE_FACE_ID);
realize_named_face (f, Qtool_bar, TOOL_BAR_FACE_ID);
realize_named_face (f, Qfringe, BITMAP_AREA_FACE_ID);
realize_named_face (f, Qheader_line, HEADER_LINE_FACE_ID);
staticpro (&Qface);
Qpixmap_spec_p = intern ("pixmap-spec-p");
staticpro (&Qpixmap_spec_p);
-
+ Qframe_update_face_colors = intern ("frame-update-face-colors");
+ staticpro (&Qframe_update_face_colors);
+
/* Lisp face attribute keywords. */
QCfamily = intern (":family");
staticpro (&QCfamily);
Qx_charset_registry = intern ("x-charset-registry");
staticpro (&Qx_charset_registry);
+ Qface_alias = intern ("face-alias");
+ staticpro (&Qface_alias);
Qdefault = intern ("default");
staticpro (&Qdefault);
- Qmodeline = intern ("modeline");
- staticpro (&Qmodeline);
+ Qmode_line = intern ("mode-line");
+ staticpro (&Qmode_line);
Qtool_bar = intern ("tool-bar");
staticpro (&Qtool_bar);
Qregion = intern ("region");
defsubr (&Spixmap_spec_p);
defsubr (&Sx_list_fonts);
defsubr (&Sinternal_face_x_get_resource);
- defsubr (&Sx_font_list);
+ defsubr (&Sx_family_fonts);
defsubr (&Sx_font_family_list);
#endif /* HAVE_X_WINDOWS */