emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 18338b1: Fix display of overlapping window-specific


From: Eli Zaretskii
Subject: [Emacs-diffs] master 18338b1: Fix display of overlapping window-specific overlays
Date: Tue, 19 May 2015 15:40:49 +0000

branch: master
commit 18338b1dff981b17426048dfa20a4c6e6e12c5aa
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix display of overlapping window-specific overlays
    
    * src/keyboard.c (adjust_point_for_property): When adjusting point
    due to display strings, ignore overlays that are specific to
    windows other than the currently selected one.
    
    * src/xdisp.c (handle_single_display_spec): If the display
    property comes from an overlay, arrange for buffer iteration to
    resume only after the end of that overlay.  (Bug#20607)
---
 src/keyboard.c |    3 ++-
 src/xdisp.c    |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 77f7fb9..eb66c44 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1702,7 +1702,8 @@ adjust_point_for_property (ptrdiff_t last_pt, bool 
modified)
       if (check_display
          && PT > BEGV && PT < ZV
          && !NILP (val = get_char_property_and_overlay
-                             (make_number (PT), Qdisplay, Qnil, &overlay))
+                             (make_number (PT), Qdisplay, selected_window,
+                              &overlay))
          && display_prop_intangible_p (val, overlay, PT, PT_BYTE)
          && (!OVERLAYP (overlay)
              ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil)
diff --git a/src/xdisp.c b/src/xdisp.c
index c2f0b74..8123719 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4899,6 +4899,20 @@ handle_single_display_spec (struct it *it, Lisp_Object 
spec, Lisp_Object object,
     {
       start_pos = *position;
       *position = display_prop_end (it, object, start_pos);
+      /* If the display property comes from an overlay, don't consider
+        any potential stop_charpos values before the end of that
+        overlay.  Since display_prop_end will happily find another
+        'display' property coming from some other overlay or text
+        property on buffer positions before this overlay's end, we
+        need to ignore them, or else we risk displaying this
+        overlay's display string/image twice.  */
+      if (!NILP (overlay))
+       {
+         ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay));
+
+         if (ovendpos > CHARPOS (*position))
+           SET_TEXT_POS (*position, ovendpos, CHAR_TO_BYTE (ovendpos));
+       }
     }
   value = Qnil;
 



reply via email to

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