[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: two display bugs involving interactions between after-string and dis
Re: two display bugs involving interactions between after-string and display properties of adjacent overlays
Fri, 29 Feb 2008 13:27:47 -0500
Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux)
Joe Wells <address@hidden> writes:
> BUG #2: An overlay's display property and after-string property are
> not displayed if an immediately following overlay shares the same Lisp
> string as its display property. (Using two distinct display strings
> with identical contents works around the bug.)
> Reproduce with this expression:
> (insert "ABCD")
> (let ((o1 (make-overlay 2 3))
> (o2 (make-overlay 3 4))
> (s #1=" "))
> (overlay-put o1 'after-string "1")
> (overlay-put o1 'display #1#)
> (overlay-put o2 'display #1#)))
> The above expression should display “A 1 D”.
> The above expression wrongly actually displays “A D”.
This occurs because, as stated in the Emacs Lisp manual, all
consecutive characters that have the same Lisp object as their
`display' property are replaced as a single unit. In this case, it's
somewhat ambiguous what the behavior should be, but after looking at
the code I think the behavior you suggest would be much more difficult
to implement (and slower) than the current behavior.
Furthermore, you can trivially obtain the behavior you want by making
a copy of the string using copy-sequence, so that the two display
strings are different Lisp objects.
Therefore, let's leave this alone.
Thanks for the report, however.