From 9247002884de0c64febb0807db428088800c39ff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 10 Apr 2011 22:58:27 -0700 Subject: [PATCH] font.c: Make copy_font_spec and merge_font_spec ordinary C functions. * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it was inaccessible from Lisp. (merge_font_spec): Likewise, renaming from Fmerge_font_spec. * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses. --- src/ChangeLog | 6 ++++++ src/font.c | 30 +++++++++++++++--------------- src/font.h | 4 ++-- src/fontset.c | 4 ++-- src/xfaces.c | 6 +++--- src/xfont.c | 2 +- 6 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 43358338c4d..a794eb9eb90 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-04-11 Paul Eggert + font.c: Make copy_font_spec and merge_font_spec ordinary C functions. + * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it + was inaccessible from Lisp. + (merge_font_spec): Likewise, renaming from Fmerge_font_spec. + * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses. + alloc.c: Import and export fewer symbols, and remove unused items. * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING is defined. diff --git a/src/font.c b/src/font.c index 91cb0a2d52b..ace1b8442d4 100644 --- a/src/font.c +++ b/src/font.c @@ -2727,7 +2727,7 @@ font_list_entities (Lisp_Object frame, Lisp_Object spec) val = null_vector; else val = Fvconcat (1, &val); - copy = Fcopy_font_spec (scratch_font_spec); + copy = copy_font_spec (scratch_font_spec); ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); } @@ -2755,7 +2755,7 @@ font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) struct font_driver_list *driver_list = f->font_driver_list; Lisp_Object ftype, size, entity; Lisp_Object frame; - Lisp_Object work = Fcopy_font_spec (spec); + Lisp_Object work = copy_font_spec (spec); XSETFRAME (frame, f); ftype = AREF (spec, FONT_TYPE_INDEX); @@ -2782,7 +2782,7 @@ font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) else { entity = driver_list->driver->match (frame, work); - copy = Fcopy_font_spec (work); + copy = copy_font_spec (work); ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache))); } @@ -2976,7 +2976,7 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop) if (! NILP (Ffont_get (font, QCname))) { - font = Fcopy_font_spec (font); + font = copy_font_spec (font); font_put_extra (font, QCname, Qnil); } @@ -2987,7 +2987,7 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop) && prop != FONT_SIZE_INDEX) return; if (EQ (font, attrs[LFACE_FONT_INDEX])) - font = Fcopy_font_spec (font); + font = copy_font_spec (font); ASET (font, prop, Qnil); if (prop == FONT_FAMILY_INDEX || prop == FONT_FOUNDRY_INDEX) { @@ -3098,7 +3098,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c) return Qnil; } - work = Fcopy_font_spec (spec); + work = copy_font_spec (spec); ASET (work, FONT_TYPE_INDEX, AREF (spec, FONT_TYPE_INDEX)); XSETFRAME (frame, f); pixel_size = font_pixel_size (f, spec); @@ -3868,9 +3868,9 @@ usage: (font-spec ARGS...) */) return spec; } -DEFUE ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0, - doc: /* Return a copy of FONT as a font-spec. */) - (Lisp_Object font) +/* Return a copy of FONT as a font-spec. */ +Lisp_Object +copy_font_spec (Lisp_Object font) { Lisp_Object new_spec, tail, prev, extra; int i; @@ -3894,18 +3894,18 @@ DEFUE ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0, return new_spec; } -DEFUE ("merge-font-spec", Fmerge_font_spec, Smerge_font_spec, 2, 2, 0, - doc: /* Merge font-specs FROM and TO, and return a new font-spec. -Every specified properties in FROM override the corresponding -properties in TO. */) - (Lisp_Object from, Lisp_Object to) +/* Merge font-specs FROM and TO, and return a new font-spec. + Every specified property in FROM overrides the corresponding + property in TO. */ +Lisp_Object +merge_font_spec (Lisp_Object from, Lisp_Object to) { Lisp_Object extra, tail; int i; CHECK_FONT (from); CHECK_FONT (to); - to = Fcopy_font_spec (to); + to = copy_font_spec (to); for (i = 0; i < FONT_EXTRA_INDEX; i++) ASET (to, i, AREF (from, i)); extra = AREF (to, FONT_EXTRA_INDEX); diff --git a/src/font.h b/src/font.h index a9b58eb7c76..ead5223a6cb 100644 --- a/src/font.h +++ b/src/font.h @@ -737,8 +737,8 @@ struct font_data_list }; EXFUN (Ffont_spec, MANY); -EXFUN (Fcopy_font_spec, 1); -EXFUN (Fmerge_font_spec, 2); +extern Lisp_Object copy_font_spec (Lisp_Object); +extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object); EXFUN (Ffont_get, 2); EXFUN (Ffont_put, 3); EXFUN (Flist_fonts, 4); diff --git a/src/fontset.c b/src/fontset.c index 4a9cc9393bf..c8452979eee 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1709,7 +1709,7 @@ int fontset_from_font (Lisp_Object font_object) { Lisp_Object font_name = font_get_name (font_object); - Lisp_Object font_spec = Fcopy_font_spec (font_object); + Lisp_Object font_spec = copy_font_spec (font_object); Lisp_Object registry = AREF (font_spec, FONT_REGISTRY_INDEX); Lisp_Object fontset_spec, alias, name, fontset; Lisp_Object val; @@ -1726,7 +1726,7 @@ fontset_from_font (Lisp_Object font_object) sprintf (temp, "fontset-auto%d", num_auto_fontsets - 1); alias = intern (temp); } - fontset_spec = Fcopy_font_spec (font_spec); + fontset_spec = copy_font_spec (font_spec); ASET (fontset_spec, FONT_REGISTRY_INDEX, alias); name = Ffont_xlfd_name (fontset_spec, Qnil); if (NILP (name)) diff --git a/src/xfaces.c b/src/xfaces.c index 920debf4dba..83f4268ad1e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1793,7 +1793,7 @@ the WIDTH times as wide as FACE on FRAME. */) { /* This is a scalable font. For backward compatibility, we set the specified size. */ - font_entity = Fcopy_font_spec (font_entity); + font_entity = copy_font_spec (font_entity); ASET (font_entity, FONT_SIZE_INDEX, AREF (font_spec, FONT_SIZE_INDEX)); } @@ -2317,9 +2317,9 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, struct if (!UNSPECIFIEDP (from[i])) { if (!UNSPECIFIEDP (to[i])) - to[i] = Fmerge_font_spec (from[i], to[i]); + to[i] = merge_font_spec (from[i], to[i]); else - to[i] = Fcopy_font_spec (from[i]); + to[i] = copy_font_spec (from[i]); if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX)); if (! NILP (AREF (to[i], FONT_FAMILY_INDEX))) diff --git a/src/xfont.c b/src/xfont.c index eaa1a3ea59b..5dd6aae3846 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -739,7 +739,7 @@ xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) So, we try again with wildcards in RESX and RESY. */ Lisp_Object temp; - temp = Fcopy_font_spec (entity); + temp = copy_font_spec (entity); ASET (temp, FONT_DPI_INDEX, Qnil); len = font_unparse_xlfd (temp, pixel_size, name, 512); if (len <= 0 || (len = xfont_encode_coding_xlfd (name)) < 0) -- 2.39.2