emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117382: Fix part of bug #18035 with overlay stri


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117382: Fix part of bug #18035 with overlay strings on invisible text.
Date: Thu, 17 Jul 2014 15:19:05 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117382
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18035
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-07-17 18:17:52 +0300
message:
  Fix part of bug #18035 with overlay strings on invisible text.
  
   src/xdisp.c (init_iterator): Initialize it->stop_charpos to the
   buffer position where we are to start the iteration.
   (handle_invisible_prop): Record in it->stop_charpos the position
   where the invisible text ends.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-16 18:39:35 +0000
+++ b/src/ChangeLog     2014-07-17 15:17:52 +0000
@@ -1,3 +1,10 @@
+2014-07-17  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (init_iterator): Initialize it->stop_charpos to the
+       buffer position where we are to start the iteration.
+       (handle_invisible_prop): Record in it->stop_charpos the position
+       where the invisible text ends.  (Bug#18035)
+
 2014-07-16  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-07-16 18:39:35 +0000
+++ b/src/xdisp.c       2014-07-17 15:17:52 +0000
@@ -3034,6 +3034,7 @@
      getting overlays and face properties from that position.  */
   if (charpos >= BUF_BEG (current_buffer))
     {
+      it->stop_charpos = charpos;
       it->end_charpos = ZV;
       eassert (charpos == BYTE_TO_CHAR (bytepos));
       IT_CHARPOS (*it) = charpos;
@@ -4546,7 +4547,24 @@
              && get_overlay_strings (it, it->stop_charpos))
            {
              handled = HANDLED_RECOMPUTE_PROPS;
-             it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
+             if (it->sp > 0)
+               {
+                 it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
+                 /* The call to get_overlay_strings above recomputes
+                    it->stop_charpos, but it only considers changes
+                    in properties and overlays beyond iterator's
+                    current position.  This causes us to miss changes
+                    that happen exactly where the invisible property
+                    ended.  So we play it safe here and force the
+                    iterator to check for potential stop positions
+                    immediately after the invisible text.  Note that
+                    if get_overlay_strings returns non-zero, it
+                    normally also pushed the iterator stack, so we
+                    need to update the stop position in the slot
+                    below the current one.  */
+                 it->stack[it->sp - 1].stop_charpos
+                   = CHARPOS (it->stack[it->sp - 1].current.pos);
+               }
            }
          else if (display_ellipsis_p)
             {


reply via email to

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