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

From: Clemens <[email-masked]>
Date: Wed, 21 Oct 2020 11:11:34 +0200

On 20.10.20 19:02, Clemens wrote:
> For now I will recommend users to 
> use the following workaround:
> 
> (define-advice fit-frame-to-buffer (:around (f &rest args) 
> dont-skip-ws-for-mini-frame)
>    (cl-letf (((symbol-function #'window-text-pixel-size)
>               (lambda (win from to &rest args)
>                 (apply #'window-text-pixel-size
>                        (append (list win from (if (and 
> (window-minibuffer-p win) (eq t to)) nil to) args))))))
>      (apply f args)))
> 

The version above invokes infinite recursion so I would rather recommend
something like the following for affected users (to avoid spamming this 
bug report with other versions here is the link to the corresponding 
issue on selectrums side: https://github.com/raxod502/selectrum/issues/169

(define-advice fit-frame-to-buffer (:around (f &rest args) 
dont-skip-ws-for-mini-frame)
   (cl-letf* ((orig (symbol-function #'window-text-pixel-size))
             ((symbol-function #'window-text-pixel-size)
              (lambda (win from to &rest args)
                (apply orig
                       (append (list win from
                                     (if (and (window-minibuffer-p win)
                                              (frame-root-window-p win)
                                              (eq t to))
                                         nil
                                       to)
                                     args))))))
     (apply f args)))