]> code.delx.au - gnu-emacs/blobdiff - src/composite.c
*** empty log message ***
[gnu-emacs] / src / composite.c
index de4ed7335aad02e77a184a612a0026409f724b40..43da8887176bf2611a708d433ed21c67d31e243b 100644 (file)
@@ -1,8 +1,8 @@
 /* Composite sequence support.
    Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
-   Licensed to the Free Software Foundation.
+     Licensed to the Free Software Foundation.
    Copyright (C) 2001 Free Software Foundation, Inc.
-   Copyright (C) 2001, 2002
+   Copyright (C) 2003
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H13PRO009
 
@@ -246,7 +246,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
     }
 
   /* This composition is a new one.  We must register it.  */
-         
+
   /* Check if we have sufficient memory to store this information.  */
   if (composition_table_size == 0)
     {
@@ -459,7 +459,7 @@ run_composition_function (from, to, prop)
       && find_composition (to, -1, &start, &end, &prop, Qnil)
       && !COMPOSITION_VALID_P (start, end, prop))
     to = end;
-  if (!NILP (func))
+  if (!NILP (Ffboundp (func)))
     call2 (func, make_number (from), make_number (to));
 }
 
@@ -470,7 +470,7 @@ run_composition_function (from, to, prop)
    It also resets the text-property `auto-composed' to a proper region
    so that automatic character composition works correctly later while
    displaying the region.
+
    This function is called when a buffer text is changed.  If the
    change is deletion, FROM == TO.  Otherwise, FROM < TO.  */
 
@@ -486,7 +486,7 @@ update_compositions (from, to, check_mask)
 
   if (inhibit_modification_hooks)
     return;
-  
+
   /* If FROM and TO are not in a valid range, do nothing.  */
   if (! (BEGV <= from && from <= to && to <= ZV))
     return;
@@ -557,10 +557,10 @@ update_compositions (from, to, check_mask)
          max_pos = end;
        }
     }
-
   if (min_pos < max_pos)
-    Fput_text_property (make_number (min_pos), make_number (max_pos),
-                       Qauto_composed, Qnil, Qnil);
+    Fremove_list_of_text_properties (make_number (min_pos),
+                                    make_number (max_pos),
+                                    Fcons (Qauto_composed, Qnil), Qnil);
 }
 
 
@@ -606,7 +606,6 @@ compose_text (start, end, components, modification_func, string)
   Fput_text_property  (make_number (start), make_number (end),
                       Qcomposition, prop, string);
 }
-
 \f
 /* Emacs Lisp APIs.  */
 
@@ -647,7 +646,7 @@ for the composition.  See `compose-string' for more detail.  */)
 
   if (XINT (start) < 0 ||
       XINT (start) > XINT (end)
-      || XINT (end) > XSTRING (string)->size)
+      || XINT (end) > SCHARS (string))
     args_out_of_range (start, end);
 
   compose_text (XINT (start), XINT (end), components, mod_func, string);
@@ -655,7 +654,7 @@ for the composition.  See `compose-string' for more detail.  */)
 }
 
 DEFUN ("find-composition-internal", Ffind_composition_internal,
-       Sfind_composition_internal, 4, 4, 0, 
+       Sfind_composition_internal, 4, 4, 0,
        doc: /* Internal use only.
 
 Return information about composition at or nearest to position POS.
@@ -676,11 +675,11 @@ See `find-composition' for more detail.  */)
     }
   else
     end = -1;
-  
+
   if (!NILP (string))
     {
       CHECK_STRING (string);
-      if (XINT (pos) < 0 || XINT (pos) > XSTRING (string)->size)
+      if (XINT (pos) < 0 || XINT (pos) > SCHARS (string))
        args_out_of_range (string, pos);
     }
   else
@@ -740,11 +739,11 @@ syms_of_composite ()
   {
     Lisp_Object args[6];
     extern Lisp_Object QCsize;
-    
+
     args[0] = QCtest;
     args[1] = Qequal;
     args[2] = QCweakness;
-    args[3] = Qnil;
+    args[3] = Qt;
     args[4] = QCsize;
     args[5] = make_number (311);
     composition_hash_table = Fmake_hash_table (6, args);