emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for fit-window-to-buffer


From: Justin Burkett
Subject: Re: Patch for fit-window-to-buffer
Date: Wed, 4 Mar 2020 15:49:50 -0500


> 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?
>

I think the (point-max) is unnecessary here actually. According to the docstring for window-text-pixel-size, nil should work here, no?

> 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?

Yes, I made that change and the previous one in the patch attached. Both work with my test case. 

Thanks,
Justin

Attachment: 0001-lisp-window.el-fit-window-to-buffer-Don-t-use-wrong-.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]