]> git.eshelyaron.com Git - emacs.git/commitdiff
(fs_load_font): Use fast_string_match_ignore_case for
authorKenichi Handa <handa@m17n.org>
Mon, 18 Oct 2004 12:28:18 +0000 (12:28 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 18 Oct 2004 12:28:18 +0000 (12:28 +0000)
comparing font names.
(fs_query_fontset): Use fast_string_match for comparing fontset
names.
(list_fontsets): Likewise.

src/ChangeLog
src/fontset.c

index 270c2ce69e5e6bb2ab13702ff816c85edf2283c1..ab4c4cd67f1aedda06c68ad347383bff2a632368 100644 (file)
@@ -1,3 +1,15 @@
+2004-10-18  Kenichi Handa  <handa@m17n.org>
+
+       * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
+       comparing font names.
+       (fs_query_fontset): Use fast_string_match for comparing fontset
+       names.
+       (list_fontsets): Likewise.
+
+       * search.c (fast_string_match_ignore_case): New function.
+
+       * lisp.h (fast_string_match_ignore_case): Extern it.
+
 2004-10-17  Kim F. Storm  <storm@cua.dk>
 
        * xdisp.c (overlay_arrow_at_row): Return overlay string rather
index 1e64c753330f4d595eaa78456015c4ed33bd2fa8..960b6fcb34b2d3e5d4fc37cbeada0ebc98d2d30d 100644 (file)
@@ -654,7 +654,7 @@ fs_load_font (f, c, fontname, id, face)
      struct face *face;
 {
   Lisp_Object fontset;
-  Lisp_Object list, elt;
+  Lisp_Object list, elt, fullname;
   int size = 0;
   struct font_info *fontp;
   int charset = CHAR_CHARSET (c);
@@ -700,10 +700,11 @@ fs_load_font (f, c, fontname, id, face)
      font_info structure that are not set by (*load_font_func).  */
   fontp->charset = charset;
 
+  fullname = build_string (fontp->full_name);
   fontp->vertical_centering
     = (STRINGP (Vvertical_centering_font_regexp)
-       && (fast_c_string_match_ignore_case
-          (Vvertical_centering_font_regexp, fontp->full_name) >= 0));
+       && (fast_string_match_ignore_case
+          (Vvertical_centering_font_regexp, fullname) >= 0));
 
   if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED)
     {
@@ -720,7 +721,6 @@ fs_load_font (f, c, fontname, id, face)
       /* The font itself doesn't have information about encoding.  */
       int i;
 
-      fontname = fontp->full_name;
       /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F),
         others is 1 (i.e. 0x80..0xFF).  */
       fontp->encoding[0] = 0;
@@ -732,8 +732,7 @@ fs_load_font (f, c, fontname, id, face)
          elt = XCAR (list);
          if (CONSP (elt)
              && STRINGP (XCAR (elt)) && CONSP (XCDR (elt))
-             && (fast_c_string_match_ignore_case (XCAR (elt), fontname)
-                 >= 0))
+             && (fast_string_match_ignore_case (XCAR (elt), fullname) >= 0))
            {
              Lisp_Object tmp;
 
@@ -847,18 +846,17 @@ fs_query_fontset (name, regexpp)
 
   for (i = 0; i < ASIZE (Vfontset_table); i++)
     {
-      Lisp_Object fontset;
-      const unsigned char *this_name;
+      Lisp_Object fontset, this_name;
 
       fontset = FONTSET_FROM_ID (i);
       if (NILP (fontset)
          || !BASE_FONTSET_P (fontset))
        continue;
 
-      this_name = SDATA (FONTSET_NAME (fontset));
+      this_name = FONTSET_NAME (fontset);
       if (regexpp
-         ? fast_c_string_match_ignore_case (name, this_name) >= 0
-         : !strcmp (SDATA (name), this_name))
+         ? fast_string_match (name, this_name) >= 0
+         : !strcmp (SDATA (name), SDATA (this_name)))
        return i;
     }
   return -1;
@@ -912,19 +910,18 @@ list_fontsets (f, pattern, size)
 
   for (id = 0; id < ASIZE (Vfontset_table); id++)
     {
-      Lisp_Object fontset;
-      const unsigned char *name;
+      Lisp_Object fontset, name;
 
       fontset = FONTSET_FROM_ID (id);
       if (NILP (fontset)
          || !BASE_FONTSET_P (fontset)
          || !EQ (frame, FONTSET_FRAME (fontset)))
        continue;
-      name = SDATA (FONTSET_NAME (fontset));
+      name = FONTSET_NAME (fontset);
 
       if (!NILP (regexp)
-         ? (fast_c_string_match_ignore_case (regexp, name) < 0)
-         : strcmp (SDATA (pattern), name))
+         ? (fast_string_match (regexp, name) < 0)
+         : strcmp (SDATA (pattern), SDATA (name)))
        continue;
 
       if (size)