Subject: bug#53216: 27.2; last line may be hidden in multi-line message

From: martin rudalics <[email-masked]>
Date: Thu, 13 Jan 2022 10:09:44 +0100

> Evaluate the form below and type 't', multi-line message is shown.
 > But I only see line '9' and line '10'.
 > The last line '11' is not shown.
 >
 > (let ((buf (generate-new-buffer "tmp"))
 >        (map (make-sparse-keymap))
 >        (func (lambda ()
 >                (interactive)
 >                (message (propertize "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11"
 >                                     'face '(:height 5.0))))))
 >    (switch-to-buffer buf)
 >    (define-key map "t" func)
 >    (use-local-map map))

The attached patch seems to fix this here but
'redisplay-adhoc-scroll-in-resize-mini-windows' is terra incognita for
me.

martin
@@ -12295,7 +12299,7 @@ resize_mini_window (struct window *w, bool exact_p)
                  don't force w->start to be at the beginning of a screen
                  line, important parts of the stuff in the mini-window,
                  such as user prompt, will be hidden from view.  */
-              move_it_by_lines (&it, 0);
+	      move_it_by_lines (&it, last_height > 0 ? 1 : 0);
               start = it.current.pos;
               /* Prevent redisplay_window from recentering, and thus from
                  overriding the window-start point we computed here.  */