From: martin rudalics <rudalics@gmx.at>
To: Justin Burkett <justin@burkett.cc>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Patch for fit-window-to-buffer
Date: Wed, 4 Mar 2020 18:31:14 +0100 [thread overview]
Message-ID: <1ff48e60-d78a-6e44-28e0-3aff795984b9@gmx.at> (raw)
In-Reply-To: <CAF8XuLgpJNyQOuc+jUdMSzOYs0D2ZOjDHnMxfgqshRNWyCUpPw@mail.gmail.com>
> 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
next prev parent reply other threads:[~2020-03-04 17:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 3:16 Patch for fit-window-to-buffer Justin Burkett
2020-03-04 17:31 ` martin rudalics [this message]
2020-03-04 20:49 ` Justin Burkett
2020-03-05 9:12 ` martin rudalics
2020-03-05 9:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ff48e60-d78a-6e44-28e0-3aff795984b9@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=justin@burkett.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).