Subject: bug#67715: 28.2; Minibuffer content is sometimes unexpectedly partially hidden

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Dec 2023 19:02:33 +0200

> From: Markus Triska <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 09 Dec 2023 10:04:18 +0100
> 
> (let ((f (selected-frame)))
>   (with-selected-frame (make-frame)
>     (switch-to-buffer (get-buffer-create "other")))
>   (select-frame-set-input-focus f)
>   (let ((win (get-buffer-window "other" t)))
>     (when win
>       (with-selected-window win
>         (recenter 0)))
>     (let ((w (selected-window)))
>       (unwind-protect
>           (progn
>             (select-window (minibuffer-window))
>             (setq-local face-remapping-alist `((default :height 2.0)))
>             (fit-window-to-buffer)
>             (insert "hello")
>             (read-key))
>         (erase-buffer))
>       (select-window w))))

This seems to work:

(let ((f (selected-frame)))
  (with-selected-frame (make-frame)
    (switch-to-buffer (get-buffer-create "other")))
  (select-frame-set-input-focus f)
  (let ((win (get-buffer-window "other" t)))
    (when win
      (with-selected-window win
        (recenter 0)))
    (let ((w (selected-window)))
      (unwind-protect
          (progn
            (select-window (minibuffer-window))
            (fit-window-to-buffer)
            (read-key (propertize "hello" 'face '(:height 2.0))))
        (erase-buffer))
      (select-window w))))

As well as this (which is a minor variant of your original recipe);

    (let ((f (selected-frame)))
      (with-selected-frame (make-frame)
        (switch-to-buffer (get-buffer-create "other")))
      (select-frame-set-input-focus f)
      (let ((win (get-buffer-window "other" t)))
        (when win
          (with-selected-window win
            (recenter 0)))
        (with-selected-window (minibuffer-window)
          (unwind-protect
              (read-key (propertize "hello" 'face '(:height 2.0)))
            (erase-buffer)))))