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: [PATCH] please review Date: Tue, 01 Oct 2019 09:39:20 +0200 Message-ID: <87o8z0ap93.fsf@kenko.localhost.com> References: <87tv8tsk3f.fsf@kenko.localhost.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="47217"; mail-complaints-to="usenet@blaine.gmane.org" To: 37563@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 01 16:32:24 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 1iFJCS-000C6b-AL for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 16:32:24 +0200 Original-Received: from localhost ([::1]:42822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJCO-0008RE-NE for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 10:32:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJCA-0008P4-V7 for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFJC9-0008GZ-K4 for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFJC8-0008Fd-Qs 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 1iFJC8-0000dN-M0 for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 10:32:04 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87tv8tsk3f.fsf@kenko.localhost.com> Resent-From: Ingo Lohmar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Oct 2019 14:32:04 +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.15699403022345 (code B ref 37563); Tue, 01 Oct 2019 14:32:04 +0000 Original-Received: (at 37563) by debbugs.gnu.org; 1 Oct 2019 14:31:42 +0000 Original-Received: from localhost ([127.0.0.1]:34255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFJBl-0000bk-QE for submit@debbugs.gnu.org; Tue, 01 Oct 2019 10:31:42 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:59349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFCkr-0005OP-CC for 37563@debbugs.gnu.org; Tue, 01 Oct 2019 03:39:30 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id C6DFC2400FC for <37563@debbugs.gnu.org>; Tue, 1 Oct 2019 09:39:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1569915562; bh=H5gAhapfT/sznivC3EGvL2HYwfUbe8VSoeoR1wxQqTs=; h=From:To:Subject:Date:From; b=V5Y0zTAjaDuZU7bXTEdUfdJ4xN8WUkia9RBGcYT5ENgMmrXupbMzNJfyrveOk8kyZ WABS/oBegDU7qEC7g+p9jpMBjBiV3BO68uXX4acV4n+un1MwYO1Tt3urZJych7gZqa le04gD1Cy5Y1tmqAxBJMWtasgATLqUzLXBGMsakDntwRdduEcaaJhrsJ4MFC6DfdBT WyMZoJniut6tZD/vOrfWgl6MPkbqLPMG2xnBtfLino4GHYjXUrlVI38rXhURr1FmkM j2/u2DHUydxGeI1zDVhcY4z8dm6n7OZ6DNKqfH/M+WscYuiRHC9u0zgkGzoUltCnbL vQ9rfe8MXt1YA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 46jB3s3vYyz9rxK for <37563@debbugs.gnu.org>; Tue, 1 Oct 2019 09:39:21 +0200 (CEST) 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:168011 Archived-At: --=-=-= Content-Type: text/plain This has an obvious fix after sleeping on it: Just increase the char-height by the line-spacing. The local var `char-height' is used once again in the function, but also with the correct meaning. Actually it should be renamed to `line-height', should I do that? Other than that, waiting for some kind of review before I commit.. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-frame-height-calculation-from-max-height.patch >From 5b9ee5b913b031fca6f424170d9b61addb090294 Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Tue, 1 Oct 2019 09:27:55 +0200 Subject: [PATCH] Fix frame height calculation from max-height When `fit-frame-to-buffer' is given a non-nil `max-height' argument, we need to work not with the char-height, but with the line-height including `line-spacing' (Bug#37563). * lisp/window.el (fit-frame-to-buffer): Account for line-spacing in height. --- lisp/window.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 620eacdd29..21b58495fa 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8637,7 +8637,10 @@ fit-frame-to-buffer (setq frame (window-normalize-frame frame)) (when (window-live-p (frame-root-window frame)) (let* ((char-width (frame-char-width frame)) - (char-height (frame-char-height frame)) + (char-height (+ (frame-char-height frame) + ;; Add line-spacing in the selected window's buffer. + (buffer-local-value 'line-spacing + (window-buffer (car (window-list)))))) ;; WINDOW is FRAME's root window. (window (frame-root-window frame)) (parent (frame-parent frame)) -- 2.23.0 --=-=-=--