emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fontset.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/fontset.c [lexbind]
Date: Mon, 25 Oct 2004 00:43:09 -0400

Index: emacs/src/fontset.c
diff -c emacs/src/fontset.c:1.67.2.7 emacs/src/fontset.c:1.67.2.8
*** emacs/src/fontset.c:1.67.2.7        Tue Jul  6 10:27:00 2004
--- emacs/src/fontset.c Mon Oct 25 04:22:26 2004
***************
*** 654,660 ****
       struct face *face;
  {
    Lisp_Object fontset;
!   Lisp_Object list, elt;
    int size = 0;
    struct font_info *fontp;
    int charset = CHAR_CHARSET (c);
--- 654,660 ----
       struct face *face;
  {
    Lisp_Object fontset;
!   Lisp_Object list, elt, fullname;
    int size = 0;
    struct font_info *fontp;
    int charset = CHAR_CHARSET (c);
***************
*** 700,709 ****
       font_info structure that are not set by (*load_font_func).  */
    fontp->charset = charset;
  
    fontp->vertical_centering
      = (STRINGP (Vvertical_centering_font_regexp)
!        && (fast_c_string_match_ignore_case
!          (Vvertical_centering_font_regexp, fontp->full_name) >= 0));
  
    if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED)
      {
--- 700,710 ----
       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_string_match_ignore_case
!          (Vvertical_centering_font_regexp, fullname) >= 0));
  
    if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED)
      {
***************
*** 720,726 ****
        /* 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;
--- 721,726 ----
***************
*** 732,739 ****
          elt = XCAR (list);
          if (CONSP (elt)
              && STRINGP (XCAR (elt)) && CONSP (XCDR (elt))
!             && (fast_c_string_match_ignore_case (XCAR (elt), fontname)
!                 >= 0))
            {
              Lisp_Object tmp;
  
--- 732,738 ----
          elt = XCAR (list);
          if (CONSP (elt)
              && STRINGP (XCAR (elt)) && CONSP (XCDR (elt))
!             && (fast_string_match_ignore_case (XCAR (elt), fullname) >= 0))
            {
              Lisp_Object tmp;
  
***************
*** 790,805 ****
        || strcmp (SDATA (pattern), CACHED_FONTSET_NAME))
      {
        /* We must at first update the cached data.  */
!       char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3);
!       char *p0, *p1 = regex;
  
-       /* Convert "*" to ".*", "?" to ".".  */
        *p1++ = '^';
        for (p0 = (char *) SDATA (pattern); *p0; p0++)
        {
          if (*p0 == '*')
            {
!             *p1++ = '.';
              *p1++ = '*';
            }
          else if (*p0 == '?')
--- 789,822 ----
        || strcmp (SDATA (pattern), CACHED_FONTSET_NAME))
      {
        /* We must at first update the cached data.  */
!       char *regex, *p0, *p1;
!       int ndashes = 0, nstars = 0;
!       
!       for (p0 = SDATA (pattern); *p0; p0++)
!       {
!         if (*p0 == '-')
!           ndashes++;
!         else if (*p0 == '*')
!           nstars++;
!       }
! 
!       /* If PATTERN is not full XLFD we conert "*" to ".*".  Otherwise
!        we convert "*" to "[^-]*" which is much faster in regular
!        expression matching.  */
!       if (ndashes < 14)
!       p1 = regex = (char *) alloca (SBYTES (pattern) + 2 * nstars + 1);
!       else
!       p1 = regex = (char *) alloca (SBYTES (pattern) + 5 * nstars + 1);
  
        *p1++ = '^';
        for (p0 = (char *) SDATA (pattern); *p0; p0++)
        {
          if (*p0 == '*')
            {
!             if (ndashes < 14)
!               *p1++ = '.';
!             else
!               *p1++ = '[', *p1++ = '^', *p1++ = '-', *p1++ = ']';
              *p1++ = '*';
            }
          else if (*p0 == '?')
***************
*** 847,864 ****
  
    for (i = 0; i < ASIZE (Vfontset_table); i++)
      {
!       Lisp_Object fontset;
!       const unsigned char *this_name;
  
        fontset = FONTSET_FROM_ID (i);
        if (NILP (fontset)
          || !BASE_FONTSET_P (fontset))
        continue;
  
!       this_name = SDATA (FONTSET_NAME (fontset));
        if (regexpp
!         ? fast_c_string_match_ignore_case (name, this_name) >= 0
!         : !strcmp (SDATA (name), this_name))
        return i;
      }
    return -1;
--- 864,880 ----
  
    for (i = 0; i < ASIZE (Vfontset_table); i++)
      {
!       Lisp_Object fontset, this_name;
  
        fontset = FONTSET_FROM_ID (i);
        if (NILP (fontset)
          || !BASE_FONTSET_P (fontset))
        continue;
  
!       this_name = FONTSET_NAME (fontset);
        if (regexpp
!         ? fast_string_match (name, this_name) >= 0
!         : !strcmp (SDATA (name), SDATA (this_name)))
        return i;
      }
    return -1;
***************
*** 912,930 ****
  
    for (id = 0; id < ASIZE (Vfontset_table); id++)
      {
!       Lisp_Object fontset;
!       const unsigned char *name;
  
        fontset = FONTSET_FROM_ID (id);
        if (NILP (fontset)
          || !BASE_FONTSET_P (fontset)
          || !EQ (frame, FONTSET_FRAME (fontset)))
        continue;
!       name = SDATA (FONTSET_NAME (fontset));
  
        if (!NILP (regexp)
!         ? (fast_c_string_match_ignore_case (regexp, name) < 0)
!         : strcmp (SDATA (pattern), name))
        continue;
  
        if (size)
--- 928,945 ----
  
    for (id = 0; id < ASIZE (Vfontset_table); id++)
      {
!       Lisp_Object fontset, name;
  
        fontset = FONTSET_FROM_ID (id);
        if (NILP (fontset)
          || !BASE_FONTSET_P (fontset)
          || !EQ (frame, FONTSET_FRAME (fontset)))
        continue;
!       name = FONTSET_NAME (fontset);
  
        if (!NILP (regexp)
!         ? (fast_string_match (regexp, name) < 0)
!         : strcmp (SDATA (pattern), SDATA (name)))
        continue;
  
        if (size)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]