[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/macterm.c
From: |
Andrew Choi |
Subject: |
[Emacs-diffs] Changes to emacs/src/macterm.c |
Date: |
Wed, 03 Jul 2002 22:43:49 -0400 |
Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.10 emacs/src/macterm.c:1.11
*** emacs/src/macterm.c:1.10 Wed Jul 3 22:10:45 2002
--- emacs/src/macterm.c Wed Jul 3 22:43:48 2002
***************
*** 10860,10870 ****
/* Return a list of at most MAXNAMES font specs matching the one in
! PATTERN. Note that each '*' in the PATTERN matches exactly one
! field of the font spec, unlike X in which an '*' in a font spec can
! match a number of fields. The result is in the Mac implementation
! all fonts must be specified by a font spec with all 13 fields
! (although many of these can be "*'s"). */
Lisp_Object
x_list_fonts (struct frame *f,
--- 10860,10868 ----
/* Return a list of at most MAXNAMES font specs matching the one in
! PATTERN. Cache matching fonts for patterns in
! dpyinfo->name_list_element to avoid looking them up again by
! calling mac_font_pattern_match (slow). */
Lisp_Object
x_list_fonts (struct frame *f,
***************
*** 10873,10886 ****
int maxnames)
{
char *ptnstr;
! Lisp_Object newlist = Qnil;
int n_fonts = 0;
int i;
struct gcpro gcpro1, gcpro2;
if (font_name_table == NULL) /* Initialize when first used. */
init_font_name_table ();
ptnstr = XSTRING (pattern)->data;
GCPRO2 (pattern, newlist);
--- 10871,10898 ----
int maxnames)
{
char *ptnstr;
! Lisp_Object newlist = Qnil, tem, key;
int n_fonts = 0;
int i;
struct gcpro gcpro1, gcpro2;
+ struct mac_display_info *dpyinfo = f ? FRAME_MAC_DISPLAY_INFO (f) : NULL;
if (font_name_table == NULL) /* Initialize when first used. */
init_font_name_table ();
+ if (dpyinfo)
+ {
+ tem = XCDR (dpyinfo->name_list_element);
+ key = Fcons (pattern, make_number (maxnames));
+
+ newlist = Fassoc (key, tem);
+ if (!NILP (newlist))
+ {
+ newlist = Fcdr_safe (newlist);
+ goto label_cached;
+ }
+ }
+
ptnstr = XSTRING (pattern)->data;
GCPRO2 (pattern, newlist);
***************
*** 10902,10907 ****
--- 10914,10927 ----
UNGCPRO;
+ if (dpyinfo)
+ {
+ XSETCDR (dpyinfo->name_list_element,
+ Fcons (Fcons (key, newlist),
+ XCDR (dpyinfo->name_list_element)));
+ }
+ label_cached:
+
return newlist;
}