1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

* src/xdisp.c (handle_invisible_prop): Fix ellipses at overlay string ends.

* test/redisplay-testsuite.el (test-redisplay): Use switch-to-buffer.

Fixes: debbugs:3874
This commit is contained in:
Chong Yidong 2012-08-20 00:19:05 +08:00
parent 6b1319cec2
commit 450809af98
4 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2012-08-19 Chong Yidong <cyd@gnu.org>
* xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
ends (Bug#3874).
2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
* .gdbinit: Use call instead of set when calling a function in the

View File

@ -4088,35 +4088,33 @@ handle_invisible_prop (struct it *it)
/* Record whether we have to display an ellipsis for the
invisible text. */
int display_ellipsis_p = (invis_p == 2);
ptrdiff_t endpos;
ptrdiff_t len, endpos;
handled = HANDLED_RECOMPUTE_PROPS;
/* Get the position at which the next visible text can be
found in IT->string, if any. */
XSETINT (limit, SCHARS (it->string));
len = SCHARS (it->string);
XSETINT (limit, len);
do
{
end_charpos = Fnext_single_property_change (charpos, Qinvisible,
it->string, limit);
if (!NILP (end_charpos))
if (INTEGERP (end_charpos))
{
endpos = XFASTINT (end_charpos);
prop = Fget_text_property (end_charpos, Qinvisible, it->string);
invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
if (invis_p == 2)
display_ellipsis_p = 1;
}
}
while (!NILP (end_charpos) && invis_p);
while (invis_p && INTEGERP (end_charpos) && endpos < len);
if (display_ellipsis_p)
{
it->ellipsis_p = 1;
handled = HANDLED_RETURN;
}
it->ellipsis_p = 1;
if (INTEGERP (end_charpos)
&& (endpos = XFASTINT (end_charpos)) < XFASTINT (limit))
if (INTEGERP (end_charpos) && endpos < len)
{
/* Text at END_CHARPOS is visible. Move IT there. */
struct text_pos old;
@ -4154,7 +4152,8 @@ handle_invisible_prop (struct it *it)
/* The rest of the string is invisible. If this is an
overlay string, proceed with the next overlay string
or whatever comes and return a character from there. */
if (it->current.overlay_string_index >= 0)
if (it->current.overlay_string_index >= 0
&& !display_ellipsis_p)
{
next_overlay_string (it);
/* Don't check for overlay strings when we just

View File

@ -1,3 +1,7 @@
2012-08-19 Chong Yidong <cyd@gnu.org>
* redisplay-testsuite.el (test-redisplay): Use switch-to-buffer.
2012-08-18 Chong Yidong <cyd@gnu.org>
* redisplay-testsuite.el (test-redisplay-4): New test (Bug#3874).

View File

@ -260,7 +260,7 @@ static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xbd, 0x81, 0xff
(let ((buf (get-buffer "*Redisplay Test*")))
(if buf
(kill-buffer buf))
(pop-to-buffer (get-buffer-create "*Redisplay Test*"))
(switch-to-buffer (get-buffer-create "*Redisplay Test*"))
(erase-buffer)
(setq buffer-invisibility-spec
'(test-redisplay--simple-invis