* Bugfix
@ 2008-02-29 3:24 Chong Yidong
0 siblings, 0 replies; only message in thread
From: Chong Yidong @ 2008-02-29 3:24 UTC (permalink / raw)
To: emacs-devel
Joe Wells <jbw@macs.hw.ac.uk> 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-29 3:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 3:24 Bugfix Chong Yidong
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).