emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog xfont.c


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/src ChangeLog xfont.c
Date: Thu, 21 May 2009 16:36:30 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/05/21 16:36:30

Modified files:
        src            : ChangeLog xfont.c 

Log message:
        (xfont_list_pattern): Don't initialize xfont_scripts_cache
        and xfont_scratch_props.
        (syms_of_xfont): Do it here instead.
        (xfont_find_ccl_program): Delete, unused.
        (xfont_open): Delete unused var `i'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7551&r2=1.7552
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xfont.c?cvsroot=emacs&r1=1.29&r2=1.30

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7551
retrieving revision 1.7552
diff -u -b -r1.7551 -r1.7552
--- ChangeLog   21 May 2009 11:24:19 -0000      1.7551
+++ ChangeLog   21 May 2009 16:36:29 -0000      1.7552
@@ -1,13 +1,21 @@
+2009-05-21  Stefan Monnier  <address@hidden>
+
+       * xfont.c (xfont_list_pattern): Don't initialize xfont_scripts_cache
+       and xfont_scratch_props.
+       (syms_of_xfont): Do it here instead.
+       (xfont_find_ccl_program): Delete, unused.
+       (xfont_open): Delete unused var `i'.
+
 2009-05-21  Kenichi Handa  <address@hidden>
 
        * fontset.c (Qlatin): Don't make it static.
 
-       * xfont.c (xfont_chars_supported, xfont_supported_scripts): New
-       functions.
+       * xfont.c (xfont_chars_supported, xfont_supported_scripts):
+       New functions.
        (xfont_scripts_cache, xfont_scratch_props): New variables.
        (Qlatin, Vscalable_fonts_allowed): Extern it.
-       (xfont_list_pattern): Argument changed.  Callers changed.  Check
-       Vscalable_fonts_allowed.  Check the support of a script.
+       (xfont_list_pattern): Argument changed.  Callers changed.
+       Check Vscalable_fonts_allowed.  Check the support of a script.
        (xfont_list): Don't reject a font spec with :script property.
        (xfont_has_char): Fix setting of encoding.
        (syms_of_xfont): Staticpro and initialize xfont_scripts_cache and
@@ -15,7 +23,7 @@
 
 2009-05-19  Kenichi Handa  <address@hidden>
 
-       * font.c (font_sort_entities): Renamed from font_sort_entites.
+       * font.c (font_sort_entities): Rename from font_sort_entites.
        Callers changed.
 
 2009-05-18  Kenichi Handa  <address@hidden>

Index: xfont.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfont.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- xfont.c     21 May 2009 11:23:41 -0000      1.29
+++ xfont.c     21 May 2009 16:36:30 -0000      1.30
@@ -49,7 +49,6 @@
 extern void x_clear_errors P_ ((Display *));
 
 static XCharStruct *xfont_get_pcm P_ ((XFontStruct *, XChar2b *));
-static void xfont_find_ccl_program P_ ((struct font *));
 
 /* Get metrics of character CHAR2B in XFONT.  Value is null if CHAR2B
    is not contained in the font.  */
@@ -119,42 +118,6 @@
          ? NULL : pcm);
 }
 
-/* Find a CCL program for a font specified by FONTP, and set the member
- `encoder' of the structure.  */
-
-static void
-xfont_find_ccl_program (font)
-     struct font *font;
-{
-  Lisp_Object list, elt;
-
-  elt = Qnil;
-  for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCDR (list))
-    {
-      elt = XCAR (list);
-      if (CONSP (elt)
-         && STRINGP (XCAR (elt))
-         && ((fast_string_match_ignore_case (XCAR (elt),
-                                             font->props[FONT_NAME_INDEX])
-              >= 0)
-             || (fast_string_match_ignore_case (XCAR (elt),
-                                                
font->props[FONT_FULLNAME_INDEX])
-                 >= 0)))
-       break;
-    }
-
-  if (! NILP (list))
-    {
-      struct ccl_program *ccl
-       = (struct ccl_program *) xmalloc (sizeof (struct ccl_program));
-
-      if (setup_ccl_program (ccl, XCDR (elt)) < 0)
-       xfree (ccl);
-      else
-       font->font_encoder = ccl;
-    }
-}
-
 static Lisp_Object xfont_get_cache P_ ((FRAME_PTR));
 static Lisp_Object xfont_list P_ ((Lisp_Object, Lisp_Object));
 static Lisp_Object xfont_match P_ ((Lisp_Object, Lisp_Object));
@@ -408,14 +371,6 @@
          script = Qnil;
        }
     }
-  if (! repertory && NILP (xfont_scripts_cache))
-    {
-      Lisp_Object args[2];
-
-      args[0] = QCtest;
-      args[1] = Qequal;
-      xfont_scripts_cache = Fmake_hash_table (2, args);
-    }
       
   BLOCK_INPUT;
   x_catch_errors (display);
@@ -439,20 +394,11 @@
   if (num_fonts > 0)
     {
       char **indices = alloca (sizeof (char *) * num_fonts);
-      Lisp_Object *props;
+      Lisp_Object *props = XVECTOR (xfont_scratch_props)->contents;
       Lisp_Object scripts = Qnil;
 
-      if (NILP (xfont_scratch_props))
-       {
-         xfont_scratch_props = Fmake_vector (make_number (8), Qnil);
-         props = XVECTOR (xfont_scratch_props)->contents;
-       }
-      else
-       {
-         props = XVECTOR (xfont_scratch_props)->contents;
-         for (i = 0; i < 8; i++)
+      for (i = 0; i < ASIZE (xfont_scratch_props); i++)
            props[i] = Qnil;
-       }
       for (i = 0; i < num_fonts; i++)
        indices[i] = names[i];
       qsort (indices, num_fonts, sizeof (char *), compare_font_names);
@@ -749,7 +695,6 @@
   Lisp_Object font_object, fullname;
   struct font *font;
   XFontStruct *xfont;
-  int i;
 
   /* At first, check if we know how to encode characters for this
      font.  */
@@ -1176,9 +1121,15 @@
 syms_of_xfont ()
 {
   staticpro (&xfont_scripts_cache);
-  xfont_scripts_cache = Qnil;
+  { /* Here we rely on the fact that syms_of_xfont (via syms_of_font)
+       is called fairly late, when QCtest and Qequal are known to be set.  */
+    Lisp_Object args[2];
+    args[0] = QCtest;
+    args[1] = Qequal;
+    xfont_scripts_cache = Fmake_hash_table (2, args);
+  }
   staticpro (&xfont_scratch_props);
-  xfont_scratch_props = Qnil;;
+  xfont_scratch_props = Fmake_vector (make_number (8), Qnil);
   xfont_driver.type = Qx;
   register_font_driver (&xfont_driver, NULL);
 }




reply via email to

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