emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100005: Support `display' text prope


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100005: Support `display' text properties and overlay strings in bidi buffers.
Date: Fri, 23 Apr 2010 18:09:11 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100005 [merge]
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2010-04-23 18:09:11 +0300
message:
  Support `display' text properties and overlay strings in bidi buffers.
  
   xdisp.c (pop_it): When the stack is popped after displaying
   from a string, bidi-iterate to exit from the text portion covered
   by the `display' property or overlay.  (Bug#5988, bug#5920)
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-04-23 09:06:43 +0000
+++ b/src/ChangeLog     2010-04-23 15:09:11 +0000
@@ -1,3 +1,11 @@
+2010-04-23  Eli Zaretskii  <address@hidden>
+
+       Support `display' text properties and overlay strings in bidi
+       buffers.
+       * xdisp.c (pop_it): When the stack is popped after displaying
+       from a string, bidi-iterate to exit from the text portion covered
+       by the `display' property or overlay.  (Bug#5988, bug#5920)
+
 2010-04-23  Dan Nicolaescu  <address@hidden>
 
        * m/macppc.h (LD_SWITCH_SYSTEM_TEMACS): Remove #undef.

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2010-04-20 18:52:07 +0000
+++ b/src/xdisp.c       2010-04-23 15:05:23 +0000
@@ -5299,6 +5299,36 @@
       break;
     case GET_FROM_BUFFER:
       it->object = it->w->buffer;
+      if (it->bidi_p)
+       {
+         /* Bidi-iterate until we get out of the portion of text, if
+            any, covered by a `display' text property or an overlay
+            with `display' property.  (We cannot just jump there,
+            because the internal coherency of the bidi iterator state
+            can not be preserved across such jumps.)  We also must
+            determine the paragraph base direction if the overlay we
+            just processed is at the beginning of a new
+            paragraph.  */
+         if (it->bidi_it.first_elt)
+           bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+         /* prev_stop can be zero, so check against BEGV as well.  */
+         while (it->bidi_it.charpos >= BEGV
+                && it->prev_stop <= it->bidi_it.charpos
+                && it->bidi_it.charpos < CHARPOS (it->position))
+           bidi_get_next_char_visually (&it->bidi_it);
+         /* Record the stop_pos we just crossed, for when we cross it
+            back, maybe.  */
+         if (it->bidi_it.charpos > CHARPOS (it->position))
+           it->prev_stop = CHARPOS (it->position);
+         /* If we ended up not where pop_it put us, resync IT's
+            positional members with the bidi iterator. */
+         if (it->bidi_it.charpos != CHARPOS (it->position))
+           {
+             SET_TEXT_POS (it->position,
+                           it->bidi_it.charpos, it->bidi_it.bytepos);
+             it->current.pos = it->position;
+           }
+       }
       break;
     case GET_FROM_STRING:
       it->object = it->string;


reply via email to

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