From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ingo Lohmar Newsgroups: gmane.emacs.bugs 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 Message-ID: <87k19gih57.fsf@kenko.localhost.com> References: <87tv8tsk3f.fsf@kenko.localhost.com> <87lfu4aook.fsf@kenko.localhost.com> <5b9fda23-4a2b-f5ff-5e49-22cdd4c857a5@gmx.at> <87d0fgamzj.fsf@kenko.localhost.com> <93140a98-fd99-7d55-0d5b-dd8c3c733521@gmx.at> <87zhiixliu.fsf@kenko.localhost.com> <87lfu1zo4z.fsf@kenko.localhost.com> <6e9ca7b7-4dcd-6038-b4fb-a5ac7d52b049@gmx.at> <87a7af7eb5.fsf@kenko.localhost.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="84317"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37563@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 07 19:46:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHX5Q-000LpM-R7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 19:46:21 +0200 Original-Received: from localhost ([::1]:48276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHX5P-0008EU-Mz for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2019 13:46:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43594) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHX5B-0008Ds-VH for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 13:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHX5A-0006Pp-RS for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 13:46:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHX5A-0006PC-E3 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 13:46:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iHX58-0002lB-9J for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2019 13:46:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ingo Lohmar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2019 17:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37563 X-GNU-PR-Package: emacs Original-Received: via spool by 37563-submit@debbugs.gnu.org id=B37563.157047033510565 (code B ref 37563); Mon, 07 Oct 2019 17:46:02 +0000 Original-Received: (at 37563) by debbugs.gnu.org; 7 Oct 2019 17:45:35 +0000 Original-Received: from localhost ([127.0.0.1]:49068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHX4h-0002kL-I5 for submit@debbugs.gnu.org; Mon, 07 Oct 2019 13:45:35 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:47013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHX4e-0002k5-VG for 37563@debbugs.gnu.org; Mon, 07 Oct 2019 13:45:33 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 5E594160062 for <37563@debbugs.gnu.org>; Mon, 7 Oct 2019 19:45:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1570470326; bh=6nqy/UMON/P/QjRyrvaUXGhTSTi1QjOHNfO4kygKKVk=; h=From:To:Cc:Subject:Date:From; b=E9uAOmJmhbKASJX+AFuFTrfWeelHmw3qyEA6rVUS+oVljSDY06KmB/1J0+9xVdYJB cwW8D+tJ+dG/yqcMsZuqW7grxlT/WcUAYdf71smqIvAFTq/Zy40+N9lwnBbCO9+gQE 5M1hu8n3LReFbGEjksIebk1ocluSdOEawh6UG8F3FmYJXPyGuF3uoX+YkbVfQ3NFUu 5TUS+LaTyOLKOjPd1XKkWUcaYjqwyy7791I/35RS6GKoKEcnyPnsxfk3mTqEgabx9a FOdbWj6myzkXU/iYztNZPvj7ur/LS5JPJbBdOWwQxg4gQ5TwZcLHk2oHGHDTJf7fMi zdtyrekuzgKMg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46n7DP1rwNz6tm7; Mon, 7 Oct 2019 19:45:25 +0200 (CEST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168565 Archived-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