bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20607: 24.5; Problem with overlays at same position but in different


From: Oleh Krehel
Subject: bug#20607: 24.5; Problem with overlays at same position but in different windows
Date: Mon, 18 May 2015 21:04:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Oleh Krehel <address@hidden>
>> Date: Mon, 18 May 2015 20:29:10 +0200
>> 
>> 
>> Suppose I have two windows, WND1 and WND2, both displaying the same
>> buffer. In WND1, there's an overlay from 1 to 2 with window property
>> WND1 and display "ab". In WND2, there's an overlay from 1 to 3 with
>> window property WND2 and display "abc".
>> 
>> Instead of the expected, I see "ab" in WND1, but "abcabc" in WND2.  When
>> I `move-overlay' in the first window to 1-3, the glitch disappears, but
>> I actually want the overlay to be 1-2, not 1-3. If I have to make it
>> 1-3, I'd have to modify the display as well to include one more
>> character from the buffer. I think it's better to fix the overlay logic
>> rather than go for this work-around.
>
> Please show the code to reproduce this.

Split the frame into 3 windows, two of them on *scratch*. In the third
window, evaluate this:

(let* ((wl (window-list))
       (w1 (nth 1 wl))
       (w2 (nth 2 wl))
       o1 o2)
  (with-current-buffer "*scratch*"
    (insert "asdf"))
  (with-selected-window w1
    (setq o1 (make-overlay 1 2))
    (overlay-put o1 'window w1)
    (overlay-put o1 'display "ok"))
  (with-selected-window w2
    (setq o2 (make-overlay 1 3))
    (overlay-put o2 'window w2)
    (overlay-put o2 'display "try")))





reply via email to

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