Subject: bug#44080: 27.1; Display behavior of overlays `after-string` in resizable minibuffer frames

From: Eli Zaretskii <[email-masked]>
Date: Mon, 19 Oct 2020 22:43:41 +0300

> From: Clemens <[email-masked]>
> Date: Mon, 19 Oct 2020 20:39:15 +0200
> 
> 1. `emacs -Q --eval "(setq default-frame-alist '((minibuffer . nil)))"`
> 2. `eval-buffer` with following code:
> 
> ```elisp
> (setq resize-mini-frames t)
> 
> (defvar ov (make-overlay (point-min) (point-min) nil t t))
> 
> (minibuffer-with-setup-hook
>      (lambda ()
>        (move-overlay ov
> 		    (point-max)
> 		    (point-max)
> 		    (current-buffer))
>         ;; Note the initial newline...
>        (overlay-put ov 'after-string "\nHey there, I'm hidden initially 
> and will hide again after any space in the input"))
>    (read-string "Hi? "))
> ```
> 
> 3. Start typing
> 
> As stated in the after-string text, it is initially hidden, shows when 
> you input some text and gets hidden again every time you type a space.

It looks like the problem is in fit-frame-to-buffer: it is not
prepared to handle after-string at the end of the prompt.
Specifically, the fact that the 2nd and the 3rd args of the call to
window-text-pixel-size are both t causes the function to return the
value which doesn't account for the after-string.