Mercurial > emacs
changeset 95044:f4fac6175e87
frame.c (Fdelete_frame): Don't call font_update_drviers if
HAVE_WINDOW_SYSTEM is not defined.
xfaces.c (merge_face_ref, merge_face_vectors)
(Finternal_set_lisp_face_attribute): Use FONT_*_INDEX only when
HAVE_WINDOW_SYSTEM is defined.
(Fface_font): Fix non-HAVE_WINDOW_SYSTEM case.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 16 May 2008 11:10:16 +0000 |
parents | 4a0b47d5274d |
children | dee9cd027812 |
files | src/frame.c src/xfaces.c |
diffstat | 2 files changed, 42 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/frame.c Fri May 16 09:30:17 2008 +0000 +++ b/src/frame.c Fri May 16 11:10:16 2008 +0000 @@ -1459,8 +1459,10 @@ memory. */ free_glyphs (f); +#ifdef HAVE_WINDOW_SYSTEM /* Give chance to each font driver to free a frame specific data. */ font_update_drivers (f, Qnil); +#endif /* Mark all the windows that used to be on FRAME as deleted, and then remove the reference to them. */
--- a/src/xfaces.c Fri May 16 09:30:17 2008 +0000 +++ b/src/xfaces.c Fri May 16 11:10:16 2008 +0000 @@ -2514,6 +2514,7 @@ && !NILP (from[LFACE_INHERIT_INDEX])) merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points); +#ifdef HAVE_WINDOW_SYSTEM i = LFACE_FONT_INDEX; if (!UNSPECIFIEDP (from[i])) { @@ -2523,6 +2524,7 @@ to[i] = Fcopy_font_spec (from[i]); ASET (to[i], FONT_SIZE_INDEX, Qnil); } +#endif for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (!UNSPECIFIEDP (from[i])) @@ -2530,8 +2532,11 @@ if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) { to[i] = merge_face_heights (from[i], to[i], to[i]); +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_SIZE_INDEX); +#endif } +#ifdef HAVE_WINDOW_SYSTEM else if (i != LFACE_FONT_INDEX) { to[i] = from[i]; @@ -2543,6 +2548,7 @@ : i == LFACE_WEIGHT_INDEX ? FONT_WEIGHT_INDEX : FONT_SLANT_INDEX)); } +#endif } /* If `font' attribute is specified, reflect the font properties in @@ -2667,7 +2673,9 @@ if (STRINGP (value)) { to[LFACE_FAMILY_INDEX] = value; +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_FAMILY_INDEX); +#endif } else err = 1; @@ -2680,7 +2688,9 @@ if (! NILP (new_height)) { to[LFACE_HEIGHT_INDEX] = new_height; +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_SIZE_INDEX); +#endif } else err = 1; @@ -2690,7 +2700,9 @@ if (SYMBOLP (value) && FONT_WEIGHT_NAME_NUMERIC (value) >= 0) { to[LFACE_WEIGHT_INDEX] = value; +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_WEIGHT_INDEX); +#endif } else err = 1; @@ -2700,7 +2712,9 @@ if (SYMBOLP (value) && FONT_SLANT_NAME_NUMERIC (value) >= 0) { to[LFACE_SLANT_INDEX] = value; +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_SLANT_INDEX); +#endif } else err = 1; @@ -2781,7 +2795,9 @@ if (SYMBOLP (value) && FONT_WIDTH_NAME_NUMERIC (value) >= 0) { to[LFACE_SWIDTH_INDEX] = value; +#ifdef HAVE_WINDOW_SYSTEM font_clear_prop (to, FONT_WIDTH_INDEX); +#endif } else err = 1; @@ -3013,9 +3029,11 @@ { Lisp_Object lface; Lisp_Object old_value = Qnil; +#ifdef HAVE_WINDOW_SYSTEM /* Set one of enum font_property_index (> 0) if ATTR is one of font-related attributes other than QCfont and QCfontset. */ enum font_property_index prop_index = 0; +#endif CHECK_SYMBOL (face); CHECK_SYMBOL (attr); @@ -3070,7 +3088,9 @@ } old_value = LFACE_FAMILY (lface); LFACE_FAMILY (lface) = value; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_FAMILY_INDEX; +#endif } else if (EQ (attr, QCheight)) { @@ -3091,7 +3111,9 @@ old_value = LFACE_HEIGHT (lface); LFACE_HEIGHT (lface) = value; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_SIZE_INDEX; +#endif } else if (EQ (attr, QCweight)) { @@ -3103,7 +3125,9 @@ } old_value = LFACE_WEIGHT (lface); LFACE_WEIGHT (lface) = value; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_WEIGHT_INDEX; +#endif } else if (EQ (attr, QCslant)) { @@ -3115,7 +3139,9 @@ } old_value = LFACE_SLANT (lface); LFACE_SLANT (lface) = value; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_SLANT_INDEX; +#endif } else if (EQ (attr, QCunderline)) { @@ -3283,7 +3309,9 @@ } old_value = LFACE_SWIDTH (lface); LFACE_SWIDTH (lface) = value; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_WIDTH_INDEX; +#endif } else if (EQ (attr, QCfont)) { @@ -3362,18 +3390,23 @@ { old_value = LFACE_WEIGHT (lface); LFACE_WEIGHT (lface) = NILP (value) ? Qnormal : Qbold; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_WEIGHT_INDEX; +#endif } else if (EQ (attr, QCitalic)) { attr = QCslant; old_value = LFACE_SLANT (lface); LFACE_SLANT (lface) = NILP (value) ? Qnormal : Qitalic; +#ifdef HAVE_WINDOW_SYSTEM prop_index = FONT_SLANT_INDEX; +#endif } else signal_error ("Invalid face attribute name", attr); +#ifdef HAVE_WINDOW_SYSTEM if (prop_index) /* If a font-related attribute other than QCfont and QCfontset is specified, and if the original QCfont attribute has a font @@ -3381,6 +3414,7 @@ the font to nil so that the font selector doesn't think that the attribute is mandatory. */ font_clear_prop (XVECTOR (lface)->contents, prop_index); +#endif /* Changing a named face means that all realized faces depending on that face are invalid. Since we cannot tell which realized faces @@ -4016,10 +4050,15 @@ face_id = FACE_FOR_CHAR (f, face, XINT (character), -1, Qnil); face = FACE_FROM_ID (f, face_id); } -#endif return (face->font ? face->font->props[FONT_NAME_INDEX] : Qnil); +#else /* !HAVE_WINDOW_SYSTEM */ + return build_string (FRAME_MSDOS_P (f) + ? "ms-dos" + : FRAME_W32_P (f) ? "w32term" + :"tty"); +#endif } }