[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bugfix
From: |
Chong Yidong |
Subject: |
Bugfix |
Date: |
Thu, 28 Feb 2008 22:24:48 -0500 |
Joe Wells <address@hidden> wrote:
> BUG #1: An overlay's after-string property that would appear at the
> end of the buffer is not displayed, if the same overlay also has a
> display property and an immediately preceding overlay also has an
> after-string property. (Putting extra characters at the end of the
> buffer works around this bug.)
To reproduce:
(progn
(if (get-buffer "*test*")
(kill-buffer "*test*"))
(pop-to-buffer "*test*")
(erase-buffer)
(insert "ABCD")
(let ((o1 (make-overlay 2 3))
(o2 (make-overlay 3 4))
(s " "))
(overlay-put o1 'after-string "1")
(overlay-put o1 'display s)
(overlay-put o2 'display s)))
I believe is a pretty safe and straightforward fix, but since it's in
the redisplay engine, it'd be good if someone double-checks before I
check it into the branch. (It's already in the trunk.)
The bug is due to an optimization in next_overlay_string that tells the
iterator to stop scanning if we're at the end of the buffer and there
are no more overlay strings to process. This fails when there's a
display string, because it->end_charpos gives the length of the string
instead of the length of the buffer. In this case, we simply shouldn't
set overlay_strings_at_end_processed_p.
*** emacs/src/xdisp.c.~1.1149.2.23.~ 2008-02-28 20:59:38.000000000 -0500
--- emacs/src/xdisp.c 2008-02-28 22:02:16.000000000 -0500
***************
*** 4677,4683 ****
/* If we're at the end of the buffer, record that we have
processed the overlay strings there already, so that
next_element_from_buffer doesn't try it again. */
! if (IT_CHARPOS (*it) >= it->end_charpos)
it->overlay_strings_at_end_processed_p = 1;
/* If we have to display `...' for invisible text, set
--- 4677,4683 ----
/* If we're at the end of the buffer, record that we have
processed the overlay strings there already, so that
next_element_from_buffer doesn't try it again. */
! if (NILP (it->string) && IT_CHARPOS (*it) >= it->end_charpos)
it->overlay_strings_at_end_processed_p = 1;
/* If we have to display `...' for invisible text, set
[Prev in Thread] |
Current Thread |
[Next in Thread] |