2011-04-11 Paul Eggert <eggert@cs.ucla.edu>
+ 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.
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)));
}
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);
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)));
}
if (! NILP (Ffont_get (font, QCname)))
{
- font = Fcopy_font_spec (font);
+ font = copy_font_spec (font);
font_put_extra (font, QCname, Qnil);
}
&& 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)
{
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);
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;
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);
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;
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))
{
/* 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));
}
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)))