From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38181: Actual height of mode-line not taken into account Date: Sat, 16 Nov 2019 17:59:21 +0200 Message-ID: <838sof7qxy.fsf@gnu.org> References: <87eeyd3ul0.fsf@bernoul.li> <83d0dt2qt6.fsf@gnu.org> <87a78xnrp0.fsf@bernoul.li> <835zjl2mzs.fsf@gnu.org> <87eey8og08.fsf@bernoul.li> <83o8xc6wsn.fsf@gnu.org> <87bltbooqq.fsf@bernoul.li> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="107687"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38181@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 16 17:00:17 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 1iW0Ud-000RjQ-VX for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2019 17:00:12 +0100 Original-Received: from localhost ([::1]:48726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iW0Uc-0005mK-8B for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2019 11:00:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55852) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iW0UW-0005mA-NE for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 11:00:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iW0UV-0008Na-Nj for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 11:00:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iW0UV-0008NP-Kf for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 11:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iW0UU-0006mC-Po for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 11:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2019 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38181 X-GNU-PR-Package: emacs Original-Received: via spool by 38181-submit@debbugs.gnu.org id=B38181.157391997125983 (code B ref 38181); Sat, 16 Nov 2019 16:00:02 +0000 Original-Received: (at 38181) by debbugs.gnu.org; 16 Nov 2019 15:59:31 +0000 Original-Received: from localhost ([127.0.0.1]:39604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iW0Tz-0006l1-FY for submit@debbugs.gnu.org; Sat, 16 Nov 2019 10:59:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iW0Tx-0006kp-Md for 38181@debbugs.gnu.org; Sat, 16 Nov 2019 10:59:30 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iW0Tr-0007af-W8; Sat, 16 Nov 2019 10:59:24 -0500 Original-Received: from [176.228.60.248] (port=2938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iW0Tr-0000sC-EW; Sat, 16 Nov 2019 10:59:23 -0500 In-reply-to: <87bltbooqq.fsf@bernoul.li> (message from Jonas Bernoulli on Sat, 16 Nov 2019 15:54:53 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:171728 Archived-At: > From: Jonas Bernoulli > Cc: 38181@debbugs.gnu.org > Date: Sat, 16 Nov 2019 15:54:53 +0100 > > > If this is to make the mode line prettier, then it should be done > > once, at the beginning of a session, right? In that case, why calling > > redisplay after loading the package or enabling a feature is not a > > solution? > > No that won't work. Each buffer has its own mode-line so when > a new buffer is created, then its height has to be calculated. Ouch! > In practice all mode-lines have the same height, so if Emacs could > use the height "that all the other buffers/windows are using" when > it does not know the actual height, then that would help. fit-window-to-buffer doesn't use (or know, really) the height of the mode line in the scenario you presented. Instead, it gets the height of the window's text area (which excludes the mode line and the header line) from the data stored in the window object. The problem is that this data is recalculated only when the window is redisplayed, so without the call to 'redisplay' we use stale data until the next redisplay cycle. However, if all the mode lines have the same height, then the problem shouldn't have happened, and so now I wonder what am I missing. If you simulate the situation where the mode line changes, while keeping its height (even if that height is unusually large), does the problem with fit-window-to-buffer still happen?