[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for fit-window-to-buffer
From: |
martin rudalics |
Subject: |
Re: Patch for fit-window-to-buffer |
Date: |
Wed, 4 Mar 2020 18:31:14 +0100 |
> I found a bug in the master and emacs-27 versions of fit-window-to-buffer.
> Another window's data might be used to determine the new width. I'm
> attaching a patch which I believe fixes the issue.
Thanks for finding these blatant bugs. The 'window-start' fix is OK.
The 'point-max' fix could be improved: Since 'window-text-pixel-size'
has to make the buffer shown in WINDOW current before processing its
text anyway, it would IMO be more efficient to wrap the entire
'window-text-pixel-size' call into a
(with-current-buffer (window-buffer window)
form and thus avoid selecting WINDOW while providing the right buffer
for 'window-text-pixel-size' right away. Can you try that?
Finally, the (frame-pixel-width) argument looks fishy too - it should
probably be (frame-pixel-width (window-frame window)). Can you verify
that as well?
Thanks, martin