Subject: bug#50096: args-out-of-range in redisplay_internal

From: Eli Zaretskii <[email-masked]>
Date: Thu, 19 Aug 2021 15:39:38 +0300

> Date: Thu, 19 Aug 2021 11:12:07 +0300
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > From: Juri Linkov <[email-masked]>
> > Cc: [email-masked]
> > Date: Thu, 19 Aug 2021 10:17:22 +0300
> > 
> > Fortunately, finally I found the shortest test case 100% reproducible
> > in 'emacs -Q'.  The line '(set-buffer (get-buffer-create "*test*"))'
> > is not necessary, it just causes a slightly different error.
> > Without 'set-buffer', the error is: (args-out-of-range 1737)
> > With 'set-buffer', the error is: (args-out-of-range 1737 1737)
> 
> Thanks.  This actually produces an assertion violation here (I guess
> your Emacs is compiled without --enable-checking).  I'll work on this.

This problem is the side effect of fixing bug#46718.  Before that fix,
we never resized mini-windows when truncate-lines was non-nil in the
buffer displayed in that window.  And now we know why.

Unfortunately, the best I could do to fix this is disable hscrolling
in display of echo-area messages (but NOT in the minibuffer editing --
that should still work).  Please see the latest master and tell if
this is acceptable.  If it isn't, the only alternative I see is to
back out the fix for bug#46718, which I suspect Clemens won't like...
Or maybe someone braver than myself will redesign and re-implement
with_echo_area_buffer in a way that avoids creating this situation
with glyph matrices in the first place.