]> code.delx.au - gnu-emacs/blobdiff - src/composite.c
Update copyright year to 2015
[gnu-emacs] / src / composite.c
index 66a20759ec67ef8476055b023116fd3b889fab58..4b22499fdd995fcbcf622dfc9dba1245e9bcc506 100644 (file)
@@ -1,5 +1,5 @@
 /* Composite sequence support.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
+   Copyright (C) 2001-2015 Free Software Foundation, Inc.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
@@ -928,7 +928,7 @@ static bool
 char_composable_p (int c)
 {
   Lisp_Object val;
-  return (c > ' '                      
+  return (c > ' '
          && (c == 0x200C || c == 0x200D
              || (val = CHAR_TABLE_REF (Vunicode_category_table, c),
                  (INTEGERP (val) && (XINT (val) <= UNICODE_CATEGORY_So)))));
@@ -1016,28 +1016,24 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
          val = CHAR_TABLE_REF (Vcomposition_function_table, c);
          if (! NILP (val))
            {
-             Lisp_Object elt;
-             int ridx;
-
-             for (ridx = 0; CONSP (val); val = XCDR (val), ridx++)
+             for (int ridx = 0; CONSP (val); val = XCDR (val), ridx++)
                {
-                 elt = XCAR (val);
+                 Lisp_Object elt = XCAR (val);
                  if (VECTORP (elt) && ASIZE (elt) == 3
                      && NATNUMP (AREF (elt, 1))
                      && charpos - 1 - XFASTINT (AREF (elt, 1)) >= start)
-                   break;
-               }
-             if (CONSP (val))
-               {
-                 cmp_it->rule_idx = ridx;
-                 cmp_it->lookback = XFASTINT (AREF (elt, 1));
-                 cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
-                 cmp_it->ch = c;
-                 return;
+                   {
+                     cmp_it->rule_idx = ridx;
+                     cmp_it->lookback = XFASTINT (AREF (elt, 1));
+                     cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
+                     cmp_it->ch = c;
+                     return;
+                   }
                }
            }
        }
-      if (charpos == endpos)
+      if (charpos == endpos
+         && !(STRINGP (string) && endpos == SCHARS (string)))
        {
          /* We couldn't find a composition point before ENDPOS.  But,
             some character after ENDPOS may be composed with
@@ -1724,7 +1720,7 @@ should be ignored.  */)
   if (! FONT_OBJECT_P (font_object))
     {
       struct coding_system *coding;
-      struct terminal *terminal = get_terminal (font_object, 1);
+      struct terminal *terminal = decode_live_terminal (font_object);
 
       coding = ((TERMINAL_TERMINAL_CODING (terminal)->common_flags
                 & CODING_REQUIRE_ENCODING_MASK)