changeset 50701:cb5f0a5d5b36

* macterm.c (x_list_fonts): Return all fonts that match if maxnames = -1.
author Andrew Choi <akochoi@shaw.ca>
date Fri, 25 Apr 2003 04:32:25 +0000
parents ad311d8949c4
children 7dd3d5eae9c7
files src/ChangeLog src/macterm.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Apr 25 02:00:17 2003 +0000
+++ b/src/ChangeLog	Fri Apr 25 04:32:25 2003 +0000
@@ -1,3 +1,8 @@
+2003-04-24  Andrew Choi  <akochoi@shaw.ca>
+
+	* macterm.c (x_list_fonts): Return all fonts that match if
+	maxnames = -1.
+
 2003-04-25  Kenichi Handa  <handa@m17n.org>
 
 	* syntax.c (skip_chars): Fix previous change.
--- a/src/macterm.c	Fri Apr 25 02:00:17 2003 +0000
+++ b/src/macterm.c	Fri Apr 25 04:32:25 2003 +0000
@@ -5825,7 +5825,8 @@
 /* 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).  */
+   calling mac_font_pattern_match (slow).  Return as many matching
+   fonts as possible if MAXNAMES = -1.  */
 
 Lisp_Object
 x_list_fonts (struct frame *f,
@@ -5868,7 +5869,7 @@
           newlist = Fcons (build_string (font_name_table[i]), newlist);
 
           n_fonts++;
-          if (n_fonts >= maxnames)
+          if (maxnames > 0 && n_fonts >= maxnames)
             break;
         }
     }