Subject: Re: bug#24109: 24.5; Long lines in message mode make Emacs irresponsive

From: Yuri D'Elia <[email-masked]>
Date: Wed, 31 Aug 2016 17:51:04 +0200

On Wed, Aug 31 2016, Eli Zaretskii <[email-masked]> wrote:
> The main loop in try_window is this:
>
>   /* Display all lines of W.  */
>   while (it.current_y < it.last_visible_y)
>     {
>       if (display_line (&it))
>       last_text_row = it.glyph_row - 1;
>       if (f->fonts_changed && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
>       return 0;
>     }
>
> Please see if the loop terminates, by setting a breakpoint on the
> 'return 0' statement and on the line after the loop.
>
> If it terminates, it means try_window does its job correctly, and we
> will need to look in the caller, redisplay_window, for the reasons of
> this infloop.

It actually terminates.

I've narrowed it down to redisplay_internal(), hitting a goto in
xdisp.c:14144:

    if (hscroll_windows (selected_window))
=>    goto retry;