emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107465: Fix bug #10903 with displayi


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107465: Fix bug #10903 with displaying an empty display string.
Date: Wed, 29 Feb 2012 19:50:24 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107465
fixes bug(s): http://debbugs.gnu.org/10903
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2012-02-29 19:50:24 +0200
message:
  Fix bug #10903 with displaying an empty display string.
  
   src/xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
   push_it before setting up the iterator for the first overlay
   string, even if we have an empty string loaded.
   (next_overlay_string): If there's an empty string on the iterator
   stack, pop the stack.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-02-25 19:39:42 +0000
+++ b/src/ChangeLog     2012-02-29 17:50:24 +0000
@@ -1,3 +1,11 @@
+2012-02-29  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
+       push_it before setting up the iterator for the first overlay
+       string, even if we have an empty string loaded.
+       (next_overlay_string): If there's an empty string on the iterator
+       stack, pop the stack.  (Bug#10903)
+
 2012-02-25  Paul Eggert  <address@hidden>
 
        Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-02-12 09:46:33 +0000
+++ b/src/xdisp.c       2012-02-29 17:50:24 +0000
@@ -5156,6 +5156,12 @@
       it->current.overlay_string_index = -1;
       it->n_overlay_strings = 0;
       it->overlay_strings_charpos = -1;
+      /* If there's an empty display string on the stack, pop the
+        stack, to resync the bidi iterator with IT's position.  Such
+        empty strings are pushed onto the stack in
+        get_overlay_strings_1.  */
+      if (it->sp > 0 && STRINGP (it->string) && !SCHARS (it->string))
+       pop_it (it);
 
       /* If we're at the end of the buffer, record that we have
         processed the overlay strings there already, so that
@@ -5453,8 +5459,15 @@
       xassert (!compute_stop_p || it->sp == 0);
 
       /* When called from handle_stop, there might be an empty display
-         string loaded.  In that case, don't bother saving it.  */
-      if (!STRINGP (it->string) || SCHARS (it->string))
+         string loaded.  In that case, don't bother saving it.  But
+         don't use this optimization with the bidi iterator, since we
+         need the corresponding pop_it call to resync the bidi
+         iterator's position with IT's position, after we are done
+         with the overlay strings.  (The corresponding call to pop_it
+         in case of an empty display string is in
+         next_overlay_string.)  */
+      if (!(!it->bidi_p
+           && STRINGP (it->string) && !SCHARS (it->string)))
        push_it (it, NULL);
 
       /* Set up IT to deliver display elements from the first overlay


reply via email to

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