emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1bb08a8: Fix overlay string display regressions int


From: Eli Zaretskii
Subject: [Emacs-diffs] master 1bb08a8: Fix overlay string display regressions introduced in Emacs 24.5
Date: Sat, 08 Aug 2015 13:56:51 +0000

branch: master
commit 1bb08a8cb10f0b8aa862d93a57edf70591fd135e
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix overlay string display regressions introduced in Emacs 24.5
    
    * src/xdisp.c (pop_it): Reset the flag to ignore overlays at this
    buffer position, if we move the iterator to a new position as
    result of jumping over text covered by a "replacing" display
    property.
    
    * test/redisplay-testsuite.el (test-redisplay-4): Add 2 new tests.
---
 src/xdisp.c                 |    6 ++++++
 test/redisplay-testsuite.el |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index e7626d1..711fe08 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5972,6 +5972,7 @@ pop_it (struct it *it)
 {
   struct iterator_stack_entry *p;
   bool from_display_prop = it->from_disp_prop_p;
+  ptrdiff_t prev_pos = IT_CHARPOS (*it);
 
   eassert (it->sp > 0);
   --it->sp;
@@ -6060,6 +6061,11 @@ pop_it (struct it *it)
                   && IT_STRING_BYTEPOS (*it) == it->bidi_it.bytepos)
               || (CONSP (it->object) && it->method == GET_FROM_STRETCH));
     }
+  /* If we move the iterator over text covered by a display property
+     to a new buffer position, any info about previously seen overlays
+     is no longer valid.  */
+  if (from_display_prop && it->sp == 0 && CHARPOS (it->position) != prev_pos)
+    it->ignore_overlay_strings_at_pos_p = false;
 }
 
 
diff --git a/test/redisplay-testsuite.el b/test/redisplay-testsuite.el
index 40a21b7..a5ec1e8 100644
--- a/test/redisplay-testsuite.el
+++ b/test/redisplay-testsuite.el
@@ -251,6 +251,41 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 
0xa5, 0xbd, 0x81, 0xff
          (str "ABC"))
       (put-text-property 1 2 'invisible 'test-redisplay--ellipsis-invis str)
       (overlay-put ov 'display str)))
+  ;; Overlay string over invisible text and non-default face.
+  (insert "\n  Expected: ..." (propertize "ABC" 'face 'highlight) "XYZ")
+  (insert "\n    Result: ")
+  (insert (propertize "foo" 'invisible 'test-redisplay--ellipsis-invis))
+  (let ((ov (make-overlay (point) (point))))
+    (overlay-put ov 'invisible t)
+    (overlay-put ov 'window (selected-window))
+    (overlay-put ov 'after-string
+                 (propertize "ABC" 'face 'highlight)))
+  (insert "XYZ\n")
+  ;; Overlay strings with partial `invisibility' property and with a
+  ;; display property on the before-string.
+  (insert "\n  Expected: A...C")
+  (insert "\n    Result: ")
+  (let ((opoint (point)))
+    (insert "X\n")
+    (let ((ov  (make-overlay opoint (1+ opoint)))
+         (str "ABC"))
+      (put-text-property 1 2 'invisible 'test-redisplay--ellipsis-invis str)
+      (overlay-put ov 'display str)))
+  (insert "\n  Expected: ..."
+          (propertize "DEF" 'display '(image :type xpm :file "close.xpm"))
+          (propertize "ABC" 'face 'highlight) "XYZ")
+  (insert "\n    Result: ")
+  (insert (propertize "foo" 'invisible 'test-redisplay--ellipsis-invis))
+  (let ((ov (make-overlay (point) (point))))
+    (overlay-put ov 'invisible t)
+    (overlay-put ov 'window (selected-window))
+    (overlay-put ov 'after-string
+                 (propertize "ABC" 'face 'highlight))
+    (overlay-put ov 'before-string
+                 (propertize "DEF"
+                             'display '(image :type xpm :file "close.xpm"))))
+  (insert "XYZ\n")
+
   ;; Overlay string with 2 adjacent and different invisible
   ;; properties.  This caused an infloop before Emacs 25.
   (insert "\n  Expected: ABC")



reply via email to

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