unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <ingo.lohmar@posteo.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 37563@debbugs.gnu.org
Subject: bug#37563: 27.0.50; fit-frame-to-buffer does not account for line-spacing
Date: Mon, 07 Oct 2019 19:45:24 +0200	[thread overview]
Message-ID: <87k19gih57.fsf@kenko.localhost.com> (raw)
In-Reply-To: <b3244e84-fea8-6f09-9054-a470c5bbed03@gmx.at>

On Mon, Oct 07 2019 11:25 (+0200), martin rudalics wrote:

> I now came up with a fix for 'fit-window-to-buffer' too which had some
> strange misbehavior with different size restricting arguments when the
> window's text size did not change.  See attached diffs and Change Log
> below.
>
>  > I think I understand better now, I was hampered by some weird debugging
>  > artifacts in my current setup.  With the default
>  > `frame-resize-pixelwise' of nil, and the otherwise bug-fixed code,
>  > nothing is cut off, but there is some slack whitespace, indeed.
>
> I suppose that part of that whitespace comes from the fact that with
> 'line-spacing' greater zero, 'window-text-pixel-size' includes the
> space below the last line of its text.  It would be nice to get rid of
> that but ISTR that a line's text may now get centered within the space
> reserved for it.  So I cannot just remove the entire line space of one
> line from the return value but probably only half of the line spacing
> value.  How would I know the right value?

I think we're talking about different things.  I was talking about the
(correct) rounding to a char-height multiple at the end of
`fit-frame-to-buffer'.  This is unaffected by the line-spacing.

Example (line-spacing 1, frame-resize-pixelwise nil):

I had 8 lines of char-height 14, leading to 8*(14+1) = 120 pixels (from
window-text-pixel-size, AFAICS) before the rounding.  Rounding to a
multiple of 14, but at least as large leads to height 126, and these 6
extra pixels are what I saw.

As an aside, the posframe pkg explicitly sets `frame-resize-pixelwise'
to t, presumable to avoid the rounding, which is the correct approach
for this package, I think.

In any case, I am happy that this will be fixed, and, coming from the
application side, have probably not much else to contribute :)

Ingo





  reply	other threads:[~2019-10-07 17:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 18:41 bug#37563: 27.0.50; fit-frame-to-buffer does not account for line-spacing Ingo Lohmar
2019-10-01  7:32 ` martin rudalics
     [not found]   ` <87lfu4aook.fsf@kenko.localhost.com>
2019-10-01  8:10     ` martin rudalics
2019-10-01  8:28       ` Ingo Lohmar
2019-10-02  8:54         ` martin rudalics
2019-10-03  8:15           ` martin rudalics
2019-10-03  8:48             ` Ingo Lohmar
2019-10-03 18:10               ` martin rudalics
2019-10-03 18:21                 ` Ingo Lohmar
2019-10-05  8:41                   ` martin rudalics
2019-10-05  9:05                     ` Ingo Lohmar
2019-10-07  9:25                       ` martin rudalics
2019-10-07 17:45                         ` Ingo Lohmar [this message]
2019-10-08  8:44                           ` martin rudalics
2019-10-11  8:16                             ` martin rudalics
2019-10-11 17:45                               ` Ingo Lohmar
2019-10-03  8:56             ` Ingo Lohmar
2019-10-03  9:12               ` Robert Pluim
2019-10-03 16:09               ` Eli Zaretskii
2019-10-03 18:10               ` martin rudalics
2019-10-03 18:22                 ` Ingo Lohmar
2019-10-01  7:39 ` bug#37563: [PATCH] please review Ingo Lohmar
2019-10-02  8:53   ` martin rudalics
     [not found] ` <handler.37563.B.156987198814967.ack@debbugs.gnu.org>
2019-10-11 17:50   ` bug#37563: Acknowledgement (27.0.50; fit-frame-to-buffer does not account for line-spacing) Ingo Lohmar

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=87k19gih57.fsf@kenko.localhost.com \
    --to=ingo.lohmar@posteo.net \
    --cc=37563@debbugs.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).