emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117539: * font.c (font_list_entities): Do not ad


From: Dmitry Antipov
Subject: [Emacs-diffs] emacs-24 r117539: * font.c (font_list_entities): Do not add empty vector to font cache.
Date: Fri, 03 Oct 2014 03:49:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117539
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-10-03 07:46:53 +0400
message:
  * font.c (font_list_entities): Do not add empty vector to font cache.
  (font_matching_entity): Likewise.  If matching entity is found, insert
  1-item vector with this entity instead of an entity itself (Bug#17125).
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-02 14:57:05 +0000
+++ b/src/ChangeLog     2014-10-03 03:46:53 +0000
@@ -1,3 +1,9 @@
+2014-10-03  Dmitry Antipov  <address@hidden>
+
+       * font.c (font_list_entities): Do not add empty vector to font cache.
+       (font_matching_entity): Likewise.  If matching entity is found, insert
+       1-item vector with this entity instead of an entity itself (Bug#17125).
+
 2014-10-02  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (move_it_by_lines): Call reseat_1 after moving the

=== modified file 'src/font.c'
--- a/src/font.c        2014-09-16 04:07:51 +0000
+++ b/src/font.c        2014-10-03 03:46:53 +0000
@@ -2756,22 +2756,21 @@
          val = XCDR (val);
        else
          {
-           Lisp_Object copy;
-
            val = driver_list->driver->list (f, scratch_font_spec);
-           if (NILP (val))
-             val = zero_vector;
-           else
-             val = Fvconcat (1, &val);
-           copy = copy_font_spec (scratch_font_spec);
-           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-           XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
+           if (!NILP (val))
+             {
+               Lisp_Object copy = copy_font_spec (scratch_font_spec);
+
+               val = Fvconcat (1, &val);
+               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+               XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
+             }
          }
-       if (ASIZE (val) > 0
+       if (VECTORP (val) && ASIZE (val) > 0
            && (need_filtering
                || ! NILP (Vface_ignored_fonts)))
          val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
-       if (ASIZE (val) > 0)
+       if (VECTORP (val) && ASIZE (val) > 0)
          list = Fcons (val, list);
       }
 
@@ -2807,18 +2806,22 @@
        && (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
       {
        Lisp_Object cache = font_get_cache (f, driver_list->driver);
-       Lisp_Object copy;
 
        ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
        entity = assoc_no_quit (work, XCDR (cache));
        if (CONSP (entity))
-         entity = XCDR (entity);
+         entity = AREF (XCDR (entity), 0);
        else
          {
            entity = driver_list->driver->match (f, work);
-           copy = copy_font_spec (work);
-           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-           XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
+           if (!NILP (entity))
+             {
+               Lisp_Object copy = copy_font_spec (work);
+               Lisp_Object match = Fvector (1, &entity);
+
+               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+               XSETCDR (cache, Fcons (Fcons (copy, match), XCDR (cache)));
+             }
          }
        if (! NILP (entity))
          break;


reply via email to

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