emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xdisp.c [emacs-unicode-2]


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c [emacs-unicode-2]
Date: Tue, 30 Sep 2003 07:07:57 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.843.2.3 emacs/src/xdisp.c:1.843.2.4
*** emacs/src/xdisp.c:1.843.2.3 Mon Sep 29 14:08:13 2003
--- emacs/src/xdisp.c   Tue Sep 30 07:07:55 2003
***************
*** 3774,3790 ****
  {
    enum prop_handled handled = HANDLED_NORMALLY;
  
!   if (! NILP (Vauto_composition_function))
      {
        Lisp_Object val;
!       int pos;
  
        if (STRINGP (it->string))
        pos = IT_STRING_CHARPOS (*it);
        else
        pos = IT_CHARPOS (*it);
  
        val =Fget_char_property (make_number (pos), Qauto_composed, it->string);
        if (NILP (val))
        {
          int count = SPECPDL_INDEX ();
--- 3774,3821 ----
  {
    enum prop_handled handled = HANDLED_NORMALLY;
  
!   if (FUNCTIONP (Vauto_composition_function))
      {
        Lisp_Object val;
!       EMACS_INT pos, this_pos;
  
        if (STRINGP (it->string))
        pos = IT_STRING_CHARPOS (*it);
        else
        pos = IT_CHARPOS (*it);
+       this_pos = pos;
  
        val =Fget_char_property (make_number (pos), Qauto_composed, it->string);
+       if (! NILP (val))
+       {
+         Lisp_Object next;
+ 
+         next = (Fnext_single_property_change
+                    (make_number (pos), Qauto_composed, it->string, Qnil));
+         if (INTEGERP (next))
+           {
+             /* The current point is auto-composed, but there exist
+                characers not yet composed beyond the auto-compused
+                region.  There's a possiblity that the last
+                characters in the region may be newly composed.  */
+             int charpos = XINT (next) - 1, bytepos, c;
+ 
+             if (STRINGP (it->string))
+               {
+                 bytepos = string_char_to_byte (it->string, charpos);
+                 c = SDATA (it->string)[bytepos];
+               }
+             else
+               {
+                 bytepos = CHAR_TO_BYTE (charpos);
+                 c = FETCH_BYTE (bytepos);
+               }
+             if (c != '\n')
+               /* If the last character is not newline, it may be
+                  composed with the following characters.  */
+               val = Qnil, pos = charpos + 1;
+           }
+       }
        if (NILP (val))
        {
          int count = SPECPDL_INDEX ();
***************
*** 3798,3804 ****
          unbind_to (count, Qnil);
  
          val = Fget_char_property (args[1], Qauto_composed, it->string);
!         if (! NILP (val))
            handled = HANDLED_RECOMPUTE_PROPS;
        }
      }
--- 3829,3835 ----
          unbind_to (count, Qnil);
  
          val = Fget_char_property (args[1], Qauto_composed, it->string);
!         if (! NILP (val) && this_pos == pos)
            handled = HANDLED_RECOMPUTE_PROPS;
        }
      }
***************
*** 3814,3820 ****
       struct it *it;
  {
    Lisp_Object prop, string;
!   EMACS_INT pos, pos_byte, end;
    enum prop_handled handled = HANDLED_NORMALLY;
  
    if (STRINGP (it->string))
--- 3845,3851 ----
       struct it *it;
  {
    Lisp_Object prop, string;
!   EMACS_INT pos, pos_byte, start, end;
    enum prop_handled handled = HANDLED_NORMALLY;
  
    if (STRINGP (it->string))
***************
*** 3833,3843 ****
    /* If there's a valid composition and point is not inside of the
       composition (in the case that the composition is from the current
       buffer), draw a glyph composed from the composition components.  */
!   if (find_composition (pos, -1, &pos, &end, &prop, string)
!       && COMPOSITION_VALID_P (pos, end, prop)
!       && (STRINGP (it->string) || (PT <= pos || PT >= end)))
      {
!       int id = get_composition_id (pos, pos_byte, end - pos, prop, string);
  
        if (id >= 0)
        {
--- 3864,3883 ----
    /* If there's a valid composition and point is not inside of the
       composition (in the case that the composition is from the current
       buffer), draw a glyph composed from the composition components.  */
!   if (find_composition (pos, -1, &start, &end, &prop, string)
!       && COMPOSITION_VALID_P (start, end, prop)
!       && (STRINGP (it->string) || (PT <= start || PT >= end)))
      {
!       int id;
! 
!       if (start != pos)
!       {
!         if (STRINGP (it->string))
!           pos_byte = string_char_to_byte (it->string, start);
!         else
!           pos_byte = CHAR_TO_BYTE (start);
!       }
!       id = get_composition_id (start, pos_byte, end - start, prop, string);
  
        if (id >= 0)
        {




reply via email to

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