From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#38181: Actual height of mode-line not taken into account Date: Tue, 12 Nov 2019 17:52:59 +0100 Message-ID: <87eeyd3ul0.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="61152"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 To: 38181@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 12 17:54:25 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 1iUZQu-000Fmq-S6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2019 17:54:24 +0100 Original-Received: from localhost ([::1]:37558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUZQs-00017X-Ut for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2019 11:54:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUZQY-00017E-Uw for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:54:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUZQY-0000pi-0U for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUZQX-0000pc-Tk for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:54:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iUZQX-0004Un-RP for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Nov 2019 16:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38181 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157357759117216 (code B ref -1); Tue, 12 Nov 2019 16:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2019 16:53:11 +0000 Original-Received: from localhost ([127.0.0.1]:58295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUZPj-0004Tc-2v for submit@debbugs.gnu.org; Tue, 12 Nov 2019 11:53:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:37767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUZPh-0004TV-J3 for submit@debbugs.gnu.org; Tue, 12 Nov 2019 11:53:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56465) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUZPg-00013v-CL for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:53:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUZPf-0000Cw-8g for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:53:08 -0500 Original-Received: from mail.hostpark.net ([212.243.197.30]:55814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iUZPf-0000CO-2v for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 11:53:07 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 730181663E for ; Tue, 12 Nov 2019 17:53:04 +0100 (CET) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id DLoXplHuE8ux for ; Tue, 12 Nov 2019 17:53:04 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 0305916618 for ; Tue, 12 Nov 2019 17:53:03 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:171462 Archived-At: If the height of the mode-line is increased by inserting an image into it, then that height is not taken into account in a buffer/window until `redisplay' has been called at least once since the buffer was created. This function can be used for testing: (defun test-popup () (interactive) (with-current-buffer (generate-new-buffer "*test*") (save-excursion (insert "one\ntwo\nthree\nfour\nfive")) (let ((win (display-buffer (current-buffer) '(display-buffer-in-side-window (side . bottom))))) ;; (redisplay) (fit-window-to-buffer win)))) First we can see that if we increase the height by modifying the `mode-line' and `mode-line-inactive' faces, then that IS taken into account. (set-face-attribute 'mode-line nil :height 250) (set-face-attribute 'mode-line-inactive nil :height 250) Now decrease the height again and try this instead: (setq-default mode-line-format (cons (propertize " " 'display (create-image "/* XPM */ static char * image[] = { \"3 60 1 1\", \"0 c #00aaff\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\", \"000\",\n\"000\",\n\"000\",\n\"000\",\n\"000\" };" 'xpm t :ascent 'center)) mode-line-format)) When you call the command now, then the lower parts of the buffer are not visible because the window is not high enough. A work-around is to call `redisplay' before calling `fit-window-to-buffer', which could be done by advising that function.