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: Tue, 01 Oct 2019 10:28:16 +0200 Message-ID: <87d0fgamzj.fsf@kenko.localhost.com> References: <87tv8tsk3f.fsf@kenko.localhost.com> <87lfu4aook.fsf@kenko.localhost.com> <5b9fda23-4a2b-f5ff-5e49-22cdd4c857a5@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="48596"; 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 Tue Oct 01 16:32:43 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 1iFJCk-000CVK-DI for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 16:32:42 +0200 Original-Received: from localhost ([::1]:42834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJCi-0000Qj-TM for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 10:32:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38909) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJCA-0008P3-Mv for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFJC9-0008GS-IZ for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFJC9-0008GI-Dt for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFJC9-0000dV-69 for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ingo Lohmar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Oct 2019 14:32:05 +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.15699403022352 (code B ref 37563); Tue, 01 Oct 2019 14:32:05 +0000 Original-Received: (at 37563) by debbugs.gnu.org; 1 Oct 2019 14:31:42 +0000 Original-Received: from localhost ([127.0.0.1]:34257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFJBm-0000bm-K4 for submit@debbugs.gnu.org; Tue, 01 Oct 2019 10:31:42 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:43443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFDWC-0006mW-Nu for 37563@debbugs.gnu.org; Tue, 01 Oct 2019 04:28:25 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 56A9B2400FB for <37563@debbugs.gnu.org>; Tue, 1 Oct 2019 10:28:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1569918498; bh=BAFh1aXSfh7Qpy6TNjATxWP1sM4UdwAyREncB1oT+NE=; h=From:To:Cc:Subject:Date:From; b=rPsNwKZss3YtLqRHkngJIxox9oU33KtnOnpK5BG+AsblfgeqlDkSUPG4DaxVQgASH yQUJng2TRVyPBqj0hYzwF19bhxI7BrblH13ABo7JpvPpC1Pj4Zpe/eGmygVCEiU4+o 9ZwXlC8pkiXh6TZ42zuOjclBy9pI2z79J90ciey85VP/BUtrb1s3ASaCPV2xmpqt5H SQnQbsVJ72YvgsETKX859rPK0pBhBjP4fTyildrKnp4Laet6RBq74YeA6ktveOy4EB 2WVC84dkQmyhuWEJ9Cxw1Zg/3XIAyPS5x4OpTI6q+ymiKGRDOCUn7DAN8QxzQDmnWP 2rG3qmL4wtE2A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46jC8J5VYKz9rxB; Tue, 1 Oct 2019 10:28:16 +0200 (CEST) In-Reply-To: <5b9fda23-4a2b-f5ff-5e49-22cdd4c857a5@gmx.at> X-Mailman-Approved-At: Tue, 01 Oct 2019 10:31:40 -0400 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:168012 Archived-At: On Tue, Oct 01 2019 10:10 (+0200), martin rudalics wrote: > > thanks for the quick reply! The fix is working for me. The separate > > window-*-height functions are much better than what I sent a few > > minutes ago, I missed all kinds of scenarios, of course. > > For consistency, I would use these functions in 'fit-window-to-buffer' > as well. But I haven't looked into all consequences yet. There's > also Bug#14825 still sitting around the corner, awaiting a proper > solution. It's somehow troubling that all these substitute canonical > character height with real line height fixes are inherently backward > incompatible. What if someone did mean to use the canonical character > height there? I surely find the complexity of all this code jarring, so I have to restrict myself to looking at a single issue; and here, it's clearly fixing a bug, using the char height is simply wrong, IMO. > > > There's one thing from my patch, however, that I think is missing in > > yours: > > I think you're right but I need to see your patch first. It's not > here yet. Debbugs and the mailing list interaction is another thing I do not really understand ;) In any case, the patch would simply be confusing now, here's the change on top of yours: @@ -8794,8 +8828,8 @@ fit-frame-to-buffer ;; Fit height to constraints. (when height (unless frame-resize-pixelwise - (setq height (* (/ (+ height char-height -1) char-height) - char-height))) + (setq height (* (/ (+ height line-height -1) line-height) + line-height))) ;; The new outer height. (setq outer-height (+ height outer-minus-body-height)) ;; Preserve margins. And then char-height can be dropped. Best, Ingo