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,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c,v
Date: Fri, 16 Jun 2006 11:53:12 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  06/06/16 11:53:12

Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1104
retrieving revision 1.1105
diff -u -b -r1.1104 -r1.1105
--- xdisp.c     14 Jun 2006 14:29:47 -0000      1.1104
+++ xdisp.c     16 Jun 2006 11:53:12 -0000      1.1105
@@ -4556,6 +4556,7 @@
 
       pop_it (it);
       xassert (it->sp > 0
+              || it->method == GET_FROM_COMPOSITION
               || (NILP (it->string)
                   && it->method == GET_FROM_BUFFER
                   && it->stop_charpos >= BEGV
@@ -4903,18 +4904,31 @@
   p->stop_charpos = it->stop_charpos;
   xassert (it->face_id >= 0);
   p->face_id = it->face_id;
-  p->image_id = it->image_id;
-  p->method = it->method;
-  if (it->method == GET_FROM_IMAGE)
-    p->string = it->object;
-  else
     p->string = it->string;
+  p->method = it->method;
+  switch (p->method)
+    {
+    case GET_FROM_IMAGE:
+      p->u.image.object = it->object;
+      p->u.image.image_id = it->image_id;
+      p->u.image.slice = it->slice;
+      break;
+    case GET_FROM_COMPOSITION:
+      p->u.comp.object = it->object;
+      p->u.comp.c = it->c;
+      p->u.comp.len = it->len;
+      p->u.comp.cmp_id = it->cmp_id;
+      p->u.comp.cmp_len = it->cmp_len;
+      break;
+    case GET_FROM_STRETCH:
+      p->u.stretch.object = it->object;
+      break;
+    }
   p->pos = it->current;
   p->end_charpos = it->end_charpos;
   p->string_nchars = it->string_nchars;
   p->area = it->area;
   p->multibyte_p = it->multibyte_p;
-  p->slice = it->slice;
   p->space_width = it->space_width;
   p->font_height = it->font_height;
   p->voffset = it->voffset;
@@ -4941,23 +4955,33 @@
   p = it->stack + it->sp;
   it->stop_charpos = p->stop_charpos;
   it->face_id = p->face_id;
-  it->method = p->method;
-  it->image_id = p->image_id;
   it->current = p->pos;
-  if (it->method == GET_FROM_IMAGE)
-    {
-      it->object = it->string;
-      it->string = Qnil;
-    }
-  else
     it->string = p->string;
   if (NILP (it->string))
     SET_TEXT_POS (it->current.string_pos, -1, -1);
+  it->method = p->method;
+  switch (it->method)
+    {
+    case GET_FROM_IMAGE:
+      it->image_id = p->u.image.image_id;
+      it->object = p->u.image.object;
+      it->slice = p->u.image.slice;
+      break;
+    case GET_FROM_COMPOSITION:
+      it->object = p->u.comp.object;
+      it->c = p->u.comp.c;
+      it->len = p->u.comp.len;
+      it->cmp_id = p->u.comp.cmp_id;
+      it->cmp_len = p->u.comp.cmp_len;
+      break;
+    case GET_FROM_STRETCH:
+      it->object = p->u.comp.object;
+      break;
+    }
   it->end_charpos = p->end_charpos;
   it->string_nchars = p->string_nchars;
   it->area = p->area;
   it->multibyte_p = p->multibyte_p;
-  it->slice = p->slice;
   it->space_width = p->space_width;
   it->font_height = p->font_height;
   it->voffset = p->voffset;
@@ -5108,16 +5132,23 @@
          continue;
       }
 
-      /* If newline has a display property that replaces the newline with 
something
-        else (image or text), find start of overlay or interval and continue 
search
-        from that point.  */
-      if (IT_CHARPOS (*it) > BEGV)
+      if (IT_CHARPOS (*it) <= BEGV)
+       break;
+
        {
-         struct it it2 = *it;
+       struct it it2;
          int pos;
          int beg, end;
          Lisp_Object val, overlay;
 
+       /* If newline is part of a composition, continue from start of 
composition */
+       if (find_composition (IT_CHARPOS (*it), -1, &beg, &end, &val, Qnil)
+           && beg < IT_CHARPOS (*it))
+         goto replaced;
+
+       /* If newline is replaced by a display property, find start of overlay
+          or interval and continue search from that point.  */
+       it2 = *it;
          pos = --IT_CHARPOS (it2);
          --IT_BYTEPOS (it2);
          it2.sp = 0;
@@ -5127,16 +5158,17 @@
              && (OVERLAYP (overlay)
                  ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)))
                  : get_property_and_range (pos, Qdisplay, &val, &beg, &end, 
Qnil)))
-           {
+         goto replaced;
+
+       /* Newline is not replaced by anything -- so we are done.  */
+       break;
+
+      replaced:
              if (beg < BEGV)
                beg = BEGV;
              IT_CHARPOS (*it) = beg;
              IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg);
-             continue;
-           }
        }
-
-      break;
     }
 
   it->continuation_lines_width = 0;
@@ -5272,6 +5304,7 @@
   IT_STRING_BYTEPOS (*it) = -1;
   it->string = Qnil;
   it->method = GET_FROM_BUFFER;
+  it->object = it->w->buffer;
   it->area = TEXT_AREA;
   it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
   it->sp = 0;
@@ -5759,6 +5792,7 @@
          IT_STRING_BYTEPOS (*it) += it->len;
          IT_STRING_CHARPOS (*it) += it->cmp_len;
          it->method = GET_FROM_STRING;
+         it->object = it->string;
          goto consider_string_end;
        }
       else
@@ -5766,6 +5800,7 @@
          IT_BYTEPOS (*it) += it->len;
          IT_CHARPOS (*it) += it->cmp_len;
          it->method = GET_FROM_BUFFER;
+         it->object = it->w->buffer;
        }
       break;
 
@@ -5795,7 +5830,10 @@
          else if (STRINGP (it->string))
            it->method = GET_FROM_STRING;
          else
+           {
            it->method = GET_FROM_BUFFER;
+             it->object = it->w->buffer;
+           }
 
          it->dpvec = NULL;
          it->current.dpvec_index = -1;
@@ -6080,6 +6118,7 @@
         setting face_before_selective_p.  */
       it->saved_face_id = it->face_id;
       it->method = GET_FROM_BUFFER;
+      it->object = it->w->buffer;
       reseat_at_next_visible_line_start (it, 1);
       it->face_before_selective_p = 1;
     }
@@ -6268,6 +6307,8 @@
                  : it->current.pos);
   if (STRINGP (it->string))
     it->object = it->string;
+  else
+    it->object = it->w->buffer;
   return 1;
 }
 
@@ -11709,9 +11750,12 @@
        }
       else
        {
+         if (string_start == NULL)
+           {
          string_before_pos = last_pos;
          string_start = glyph;
          string_start_x = x;
+           }
          /* Skip all glyphs from string.  */
          do
            {




reply via email to

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