Commit 239f9db9 authored by Paul Eggert's avatar Paul Eggert

* font.c, fontset.c: Make symbols static if they're not exported.

* dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
(FACE_SUITABLE_FOR_CHAR_P): Use it.
* font.c (font_close_object): Now static.
* font.h (font_close_object): Remove.
* fontset.c (FONTSET_OBJLIST): Remove.
(free_realized_fontset) #if-0 the body, which does nothing.
(face_suitable_for_char_p): #if-0, as it's never called.
* fontset.h (face_suitable_for_char_p): Remove decl.
* xfaces.c (face_at_string_position): Use
FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
since 0 is always ASCII.
parent dfcf3579
2011-04-13 Paul Eggert <eggert@cs.ucla.edu>
* font.c, fontset.c: Make symbols static if they're not exported.
* dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
(FACE_SUITABLE_FOR_CHAR_P): Use it.
* font.c (font_close_object): Now static.
* font.h (font_close_object): Remove.
* fontset.c (FONTSET_OBJLIST): Remove.
(free_realized_fontset) #if-0 the body, which does nothing.
(face_suitable_for_char_p): #if-0, as it's never called.
* fontset.h (face_suitable_for_char_p): Remove decl.
* xfaces.c (face_at_string_position): Use
FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
since 0 is always ASCII.
* fns.c (weak_hash_tables): Now static.
* fileio.c: Make symbols static if they're not exported.
......
......@@ -1733,9 +1733,12 @@ struct face_cache
/* Non-zero if FACE is suitable for displaying character CHAR. */
#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \
((FACE) == (FACE)->ascii_face)
#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) \
(ASCII_CHAR_P (CHAR) \
? (FACE) == (FACE)->ascii_face \
? FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE) \
: face_suitable_for_char_p ((FACE), (CHAR)))
/* Return the id of the realized face on frame F that is like the face
......
......@@ -2872,7 +2872,7 @@ font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size)
/* Close FONT_OBJECT that is opened on frame F. */
void
static void
font_close_object (FRAME_PTR f, Lisp_Object font_object)
{
struct font *font = XFONT_OBJECT (font_object);
......
......@@ -779,7 +779,6 @@ extern void font_done_for_face (FRAME_PTR f, struct face *face);
extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name);
extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol);
extern void font_update_sort_order (int *order);
......
......@@ -238,7 +238,7 @@ fontset_id_valid_p (int id)
/* Macros to access special values of (realized) FONTSET. */
#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
#define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4]
/* #define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] */
#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */
#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
......@@ -838,6 +838,7 @@ fontset_ascii (int id)
static void
free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
{
#if 0
Lisp_Object tail;
if (0)
......@@ -846,6 +847,7 @@ free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
xassert (FONT_OBJECT_P (XCAR (tail)));
font_close_object (f, XCAR (tail));
}
#endif
}
/* Free fontset of FACE defined on frame F. Called from
......@@ -881,6 +883,7 @@ free_face_fontset (FRAME_PTR f, struct face *face)
}
#if 0
/* Return 1 if FACE is suitable for displaying character C.
Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P
when C is not an ASCII character. */
......@@ -896,6 +899,7 @@ face_suitable_for_char_p (struct face *face, int c)
&& INTEGERP (RFONT_DEF_FACE (rfont_def))
&& face->id == XINT (RFONT_DEF_FACE (rfont_def)));
}
#endif
/* Return ID of face suitable for displaying character C on frame F.
......
......@@ -32,7 +32,6 @@ extern void (*check_window_system_func) (void);
struct face;
extern void free_face_fontset (FRAME_PTR, struct face *);
extern int face_suitable_for_char_p (struct face *, int);
extern int face_for_char (FRAME_PTR, struct face *, int,
int, Lisp_Object);
extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object);
......@@ -51,4 +50,3 @@ struct font;
extern int face_for_font (struct frame *, Lisp_Object, struct face *);
#endif /* EMACS_FONTSET_H */
......@@ -6179,7 +6179,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
if we don't have fonts, so we can stop here if not working
on a window-system frame. */
|| !FRAME_WINDOW_P (f)
|| FACE_SUITABLE_FOR_CHAR_P (base_face, 0)))
|| FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face, 0)))
return base_face->id;
/* Begin with attributes from the base face. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment