char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg";
/* The name of the function to call when the background of the frame
- has changed, frame_update_face_colors. */
+ has changed, frame_set_background_mode. */
-Lisp_Object Qframe_update_face_colors;
+Lisp_Object Qframe_set_background_mode;
/* Names of basic faces. */
Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe;
Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu;
-Lisp_Object Qmode_line_inactive;
+Lisp_Object Qmode_line_inactive, Qvertical_border;
extern Lisp_Object Qmode_line;
/* The symbol `face-alias'. A symbols having that property is an
Lisp_Object Qface_alias;
+extern Lisp_Object Qcircular_list;
+
/* Default stipple pattern used on monochrome displays. This stipple
pattern is used on monochrome displays instead of shades of gray
for a face background color. See `set-face-stipple' for possible
static void map_tty_color P_ ((struct frame *, struct face *,
enum lface_attribute_index, int *));
-static Lisp_Object resolve_face_name P_ ((Lisp_Object));
+static Lisp_Object resolve_face_name P_ ((Lisp_Object, int));
static int may_use_scalable_font_p P_ ((const char *));
static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
static int better_font_p P_ ((int *, struct font_name *, struct font_name *,
\f
+static Lisp_Object
+internal_resolve_face_name (nargs, args)
+ int nargs;
+ Lisp_Object *args;
+{
+ Fget (args[0], args[1]);
+}
+
+static Lisp_Object
+resolve_face_name_error (ignore)
+ Lisp_Object ignore;
+{
+ return Qnil;
+}
/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it
- to make it a symvol. If FACE_NAME is an alias for another face,
- return that face's name. */
+ to make it a symbol. If FACE_NAME is an alias for another face,
+ return that face's name.
+
+ Return default face in case of errors. */
static Lisp_Object
-resolve_face_name (face_name)
+resolve_face_name (face_name, signal_p)
Lisp_Object face_name;
+ int signal_p;
{
- Lisp_Object aliased;
+ Lisp_Object orig_face;
+ Lisp_Object tortoise, hare;
if (STRINGP (face_name))
face_name = intern (SDATA (face_name));
- while (SYMBOLP (face_name))
+ if (NILP (face_name) || !SYMBOLP (face_name))
+ return face_name;
+
+ orig_face = face_name;
+ tortoise = hare = face_name;
+
+ while (1)
{
- aliased = Fget (face_name, Qface_alias);
- if (NILP (aliased))
+ face_name = hare;
+ hare = Fget (hare, Qface_alias);
+ if (NILP (hare) || !SYMBOLP (hare))
break;
- else
- face_name = aliased;
+
+ face_name = hare;
+ hare = Fget (hare, Qface_alias);
+ if (NILP (hare) || !SYMBOLP (hare))
+ break;
+
+ tortoise = Fget (tortoise, Qface_alias);
+ if (EQ (hare, tortoise))
+ {
+ if (signal_p)
+ Fsignal (Qcircular_list, Fcons (orig_face, Qnil));
+ return Qdefault;
+ }
}
return face_name;
{
Lisp_Object lface;
- face_name = resolve_face_name (face_name);
+ face_name = resolve_face_name (face_name, signal_p);
if (f)
lface = assq_no_quit (face_name, f->face_alist);
CHECK_SYMBOL (face);
CHECK_SYMBOL (attr);
- face = resolve_face_name (face);
+ face = resolve_face_name (face, 1);
/* If FRAME is 0, change face on all frames, and change the
default for new frames. */
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. */
+ mode, so that we have to load new defface specs.
+ Call frame-set-background-mode to do that. */
XSETFRAME (frame, f);
- call1 (Qframe_update_face_colors, frame);
+ call1 (Qframe_set_background_mode, frame);
face = Qdefault;
lface = lface_from_face_name (f, face, 1);
DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p,
Sinternal_lisp_face_equal_p, 2, 3, 0,
doc: /* True if FACE1 and FACE2 are equal.
-If the optional argument FRAME is given, report on face FACE in that frame.
-If FRAME is t, report on the defaults for face FACE (for new frames).
+If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame.
+If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames).
If FRAME is omitted or nil, use the selected frame. */)
(face1, face2, frame)
Lisp_Object face1, face2, frame;
Emacs. That frame is not an X frame. */
f = frame_or_selected_frame (frame, 2);
- lface1 = lface_from_face_name (NULL, face1, 1);
- lface2 = lface_from_face_name (NULL, face2, 1);
+ lface1 = lface_from_face_name (f, face1, 1);
+ lface2 = lface_from_face_name (f, face2, 1);
equal_p = lface_equal_p (XVECTOR (lface1)->contents,
XVECTOR (lface2)->contents);
return equal_p ? Qt : Qnil;
1, 2, 0,
doc: /* Return non-nil if all the face attributes in ATTRIBUTES are supported.
The optional argument DISPLAY can be a display name, a frame, or
-nil (meaning the selected frame's display)
+nil (meaning the selected frame's display).
The definition of `supported' is somewhat heuristic, but basically means
that a face containing all the attributes in ATTRIBUTES, when merged
any display that can display bold, and a `:foreground \"yellow\"' as long
as it can display a yellowish color, but `:slant italic' will _not_ be
satisfied by the tty display code's automatic substitution of a `dim'
-face for italic. */)
+face for italic. */)
(attributes, display)
Lisp_Object attributes, display;
{
if (font->numeric[XLFD_RESY] != 0)
{
pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5;
- pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt;
+ pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt + 0.5;
}
else
{
pt = specified_pt;
- pixel_value = resy / (PT_PER_INCH * 10.0) * pt;
+ pixel_value = resy / (PT_PER_INCH * 10.0) * pt + 0.5;
}
/* We may need a font of the different size. */
pixel_value *= font->rescale_ratio;
realize_named_face (f, Qcursor, CURSOR_FACE_ID);
realize_named_face (f, Qmouse, MOUSE_FACE_ID);
realize_named_face (f, Qmenu, MENU_FACE_ID);
+ realize_named_face (f, Qvertical_border, VERTICAL_BORDER_FACE_ID);
/* Reflect changes in the `menu' face in menu bars. */
if (FRAME_FACE_CACHE (f)->menu_face_changed_p)
int c;
struct face *base_face;
{
+ struct face *face = NULL;
#ifdef HAVE_WINDOW_SYSTEM
- struct face *face, *default_face;
+ struct face *default_face;
struct frame *f;
Lisp_Object stipple, overline, strike_through, box;
face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h);
xassert (FACE_SUITABLE_FOR_CHAR_P (face, c));
- return face;
#endif /* HAVE_WINDOW_SYSTEM */
+ return face;
}
staticpro (&Qface_no_inherit);
Qbitmap_spec_p = intern ("bitmap-spec-p");
staticpro (&Qbitmap_spec_p);
- Qframe_update_face_colors = intern ("frame-update-face-colors");
- staticpro (&Qframe_update_face_colors);
+ Qframe_set_background_mode = intern ("frame-set-background-mode");
+ staticpro (&Qframe_set_background_mode);
/* Lisp face attribute keywords. */
QCfamily = intern (":family");
staticpro (&Qmouse);
Qmode_line_inactive = intern ("mode-line-inactive");
staticpro (&Qmode_line_inactive);
+ Qvertical_border = intern ("vertical-border");
+ staticpro (&Qvertical_border);
Qtty_color_desc = intern ("tty-color-desc");
staticpro (&Qtty_color_desc);
Qtty_color_standard_values = intern ("tty-color-standard-values");