unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>, Morgan Smith <Morgan.J.Smith@outlook.com>
Cc: 70894@debbugs.gnu.org
Subject: bug#70894: [PATCH] * lisp/window.el (fit-window-to-buffer): Fix width calculation
Date: Sun, 19 May 2024 09:58:58 +0200	[thread overview]
Message-ID: <e1948bbd-2af4-4766-9358-9cb358a59671@gmx.at> (raw)
In-Reply-To: <86jzjre9xh.fsf@gnu.org>

 > Martin, any comments?

Looks good to me.  Principally, instead of subtracting the sizes of the
decorations from the initial total width and re-adding them later, they
should have been added to the calculated pixel width as is done when
fitting the height.

But mildly spoken, 'fit-window-to-buffer' is a complete mess in the
first place.  Calculating sizes in terms of lines/columns doesn't make
sense.  If really necessary - minibuffer resizing, for example, does not
care - results should be rounded in a final step.  Also, I doubt that
both char-width and char-height are calculated reasonably when buffer
text is scaled or line spacing changed.

martin





  reply	other threads:[~2024-05-19  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 13:25 bug#70894: [PATCH] * lisp/window.el (fit-window-to-buffer): Fix width calculation Morgan Smith
2024-05-18  9:39 ` Eli Zaretskii
2024-05-19  7:58   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-19  8:09     ` Eli Zaretskii
2024-05-19  9:22       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=e1948bbd-2af4-4766-9358-9cb358a59671@gmx.at \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70894@debbugs.gnu.org \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /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).