Subject: bug#23124: Two minibuffer resize related bugs

From: martin rudalics <[email-masked]>
Date: Tue, 29 Mar 2016 17:12:56 +0200

>> (1) Save the attached foo.el file somewhere and make its first line match
 >>       the location where you stored it.
 >>
 >> (2) Start Emacs with the options -Q and -l to load foo.el.
 >>
 >> (3) Type C-x 5 2.
 >>
 >> (4) Go back to the initial frame, move to the end of the last non-empty
 >>       line after ";; (bar)" and type C-x C-e.
 >>
 >> At this moment "nothing" happens here (Bug#1).  When I now switch (via
 >> Alt TAB) to the new frame (the one created via C-x 5 2), the message
 >> appears there.  When I now type C-p in the new frame, the minibuffer
 >> window shrinks back but the space previously occupied by the modeline of
 >> the window above is not redrawn, hence I get two modelines above each
 >> other (Bug#2).

I've now traced this behavior back to this

commit 9d6ec23f7d4f8fbbfdcea353c4b58e47f76a7342
Author: Eli Zaretskii <[email-masked]>
Date:   Sat Oct 24 18:54:15 2015 +0300

     Update frame title when redisplay scrolls selected window

     * src/xdisp.c (redisplay_window): Reconsider the frame's title
     when the mode-line of the frame's selected window needs to be
     updated.

In fact, removing the

       x_consider_frame_title (w->frame);

call from redisplay_window fixes both bugs here.

 > Let's start with a much simpler reproducer:
 >
 >    . emacs -Q
 >    . Type "C-x" and wait until you see "C-x-" in the echo area
 >    . Type "5 2"
 >
 > Result: a new frame is displayed, with both frames showing the
 > "C-x 5 2" echo, which already sounds like a bug (only one frame should
 > show it).
 >
 > Now type "C-p" -- only one of the two echo messages will disappear,
 > the one in the non-selected window stays put.
 >
 > This didn't happen in Emacs 24.5, where the "C-x 5 2" echo is first
 > cleared, and then redisplayed after the new frame is created.
 >
 > According to my testing, this problem appeared between Aug 31 and Sep
 > 30 last year.

This a different problem preceding the one I described.

martin