aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2004-10-18 12:28:18 +0000
committerKenichi Handa2004-10-18 12:28:18 +0000
commit6e1b0d8c4f8db76307825736094ec8f57dcd2e6e (patch)
treed22a0640d1b7f901967d30825f69ee441cecdb65 /src
parentbe5f4dfb0144b5aa94c51a82acf6dd073efc3527 (diff)
downloademacs-6e1b0d8c4f8db76307825736094ec8f57dcd2e6e.tar.gz
emacs-6e1b0d8c4f8db76307825736094ec8f57dcd2e6e.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/fontset.c29
2 files changed, 25 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 270c2ce69e5..ab4c4cd67f1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12004-10-18 Kenichi Handa <handa@m17n.org>
2
3 * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
4 comparing font names.
5 (fs_query_fontset): Use fast_string_match for comparing fontset
6 names.
7 (list_fontsets): Likewise.
8
9 * search.c (fast_string_match_ignore_case): New function.
10
11 * lisp.h (fast_string_match_ignore_case): Extern it.
12
12004-10-17 Kim F. Storm <storm@cua.dk> 132004-10-17 Kim F. Storm <storm@cua.dk>
2 14
3 * xdisp.c (overlay_arrow_at_row): Return overlay string rather 15 * xdisp.c (overlay_arrow_at_row): Return overlay string rather
diff --git a/src/fontset.c b/src/fontset.c
index 1e64c753330..960b6fcb34b 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -654,7 +654,7 @@ fs_load_font (f, c, fontname, id, face)
654 struct face *face; 654 struct face *face;
655{ 655{
656 Lisp_Object fontset; 656 Lisp_Object fontset;
657 Lisp_Object list, elt; 657 Lisp_Object list, elt, fullname;
658 int size = 0; 658 int size = 0;
659 struct font_info *fontp; 659 struct font_info *fontp;
660 int charset = CHAR_CHARSET (c); 660 int charset = CHAR_CHARSET (c);
@@ -700,10 +700,11 @@ fs_load_font (f, c, fontname, id, face)
700 font_info structure that are not set by (*load_font_func). */ 700 font_info structure that are not set by (*load_font_func). */
701 fontp->charset = charset; 701 fontp->charset = charset;
702 702
703 fullname = build_string (fontp->full_name);
703 fontp->vertical_centering 704 fontp->vertical_centering
704 = (STRINGP (Vvertical_centering_font_regexp) 705 = (STRINGP (Vvertical_centering_font_regexp)
705 && (fast_c_string_match_ignore_case 706 && (fast_string_match_ignore_case
706 (Vvertical_centering_font_regexp, fontp->full_name) >= 0)); 707 (Vvertical_centering_font_regexp, fullname) >= 0));
707 708
708 if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED) 709 if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED)
709 { 710 {
@@ -720,7 +721,6 @@ fs_load_font (f, c, fontname, id, face)
720 /* The font itself doesn't have information about encoding. */ 721 /* The font itself doesn't have information about encoding. */
721 int i; 722 int i;
722 723
723 fontname = fontp->full_name;
724 /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F), 724 /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F),
725 others is 1 (i.e. 0x80..0xFF). */ 725 others is 1 (i.e. 0x80..0xFF). */
726 fontp->encoding[0] = 0; 726 fontp->encoding[0] = 0;
@@ -732,8 +732,7 @@ fs_load_font (f, c, fontname, id, face)
732 elt = XCAR (list); 732 elt = XCAR (list);
733 if (CONSP (elt) 733 if (CONSP (elt)
734 && STRINGP (XCAR (elt)) && CONSP (XCDR (elt)) 734 && STRINGP (XCAR (elt)) && CONSP (XCDR (elt))
735 && (fast_c_string_match_ignore_case (XCAR (elt), fontname) 735 && (fast_string_match_ignore_case (XCAR (elt), fullname) >= 0))
736 >= 0))
737 { 736 {
738 Lisp_Object tmp; 737 Lisp_Object tmp;
739 738
@@ -847,18 +846,17 @@ fs_query_fontset (name, regexpp)
847 846
848 for (i = 0; i < ASIZE (Vfontset_table); i++) 847 for (i = 0; i < ASIZE (Vfontset_table); i++)
849 { 848 {
850 Lisp_Object fontset; 849 Lisp_Object fontset, this_name;
851 const unsigned char *this_name;
852 850
853 fontset = FONTSET_FROM_ID (i); 851 fontset = FONTSET_FROM_ID (i);
854 if (NILP (fontset) 852 if (NILP (fontset)
855 || !BASE_FONTSET_P (fontset)) 853 || !BASE_FONTSET_P (fontset))
856 continue; 854 continue;
857 855
858 this_name = SDATA (FONTSET_NAME (fontset)); 856 this_name = FONTSET_NAME (fontset);
859 if (regexpp 857 if (regexpp
860 ? fast_c_string_match_ignore_case (name, this_name) >= 0 858 ? fast_string_match (name, this_name) >= 0
861 : !strcmp (SDATA (name), this_name)) 859 : !strcmp (SDATA (name), SDATA (this_name)))
862 return i; 860 return i;
863 } 861 }
864 return -1; 862 return -1;
@@ -912,19 +910,18 @@ list_fontsets (f, pattern, size)
912 910
913 for (id = 0; id < ASIZE (Vfontset_table); id++) 911 for (id = 0; id < ASIZE (Vfontset_table); id++)
914 { 912 {
915 Lisp_Object fontset; 913 Lisp_Object fontset, name;
916 const unsigned char *name;
917 914
918 fontset = FONTSET_FROM_ID (id); 915 fontset = FONTSET_FROM_ID (id);
919 if (NILP (fontset) 916 if (NILP (fontset)
920 || !BASE_FONTSET_P (fontset) 917 || !BASE_FONTSET_P (fontset)
921 || !EQ (frame, FONTSET_FRAME (fontset))) 918 || !EQ (frame, FONTSET_FRAME (fontset)))
922 continue; 919 continue;
923 name = SDATA (FONTSET_NAME (fontset)); 920 name = FONTSET_NAME (fontset);
924 921
925 if (!NILP (regexp) 922 if (!NILP (regexp)
926 ? (fast_c_string_match_ignore_case (regexp, name) < 0) 923 ? (fast_string_match (regexp, name) < 0)
927 : strcmp (SDATA (pattern), name)) 924 : strcmp (SDATA (pattern), SDATA (name)))
928 continue; 925 continue;
929 926
930 if (size) 927 if (size)