From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#38181: Actual height of mode-line not taken into account Date: Sat, 16 Nov 2019 20:30:11 +0100 Message-ID: References: <87eeyd3ul0.fsf@bernoul.li> <83d0dt2qt6.fsf@gnu.org> <83r2290w24.fsf@gnu.org> <83pnhs6wwp.fsf@gnu.org> <878sofon8v.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="191322"; 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 20:31:37 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 1iW3nE-000ndI-Mk for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2019 20:31:36 +0100 Original-Received: from localhost ([::1]:49776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iW3nD-0005TI-Db for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2019 14:31:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46925) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iW3mh-0005T7-Gt for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 14:31:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iW3mg-0002Bi-D5 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 14:31:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iW3mg-0002BZ-9u for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 14:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iW3mg-0003Py-4u for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2019 14:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2019 19:31: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.157393262213091 (code B ref 38181); Sat, 16 Nov 2019 19:31:02 +0000 Original-Received: (at 38181) by debbugs.gnu.org; 16 Nov 2019 19:30:22 +0000 Original-Received: from localhost ([127.0.0.1]:39722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iW3m1-0003P4-Tq for submit@debbugs.gnu.org; Sat, 16 Nov 2019 14:30:22 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:40805) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iW3ly-0003Oo-DT for 38181@debbugs.gnu.org; Sat, 16 Nov 2019 14:30:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1573932612; bh=tl0HPEOMgL3TiqpXTd2dLaeXLQrrsdj6XehvjdUHjV4=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=RD9a6xEYGByO0zM1HHS/sp44kZxAHl7Oe9VFHyDtjcBU+OuIS16aJDDCbz5VOhrLA KxbHAecG887cx+7MQfSqDQKFpbB8CISTZDSNyexiFgEhtieUV3aDPEbd0CWQvCUjQA vIez6g324SIsegaKsO2JnUzoWUdnqruv6B7XihVM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.86]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKbg4-1iHg9Q1LjQ-00KxRk; Sat, 16 Nov 2019 20:30:12 +0100 In-Reply-To: <878sofon8v.fsf@bernoul.li> Content-Language: de-AT X-Provags-ID: V03:K1:earPChNY/BcSwyL4PTkabyUhnpO99Td+eMfvJjjk7fnfFcIQ7La 5l2OBEHrCMFnJrdTAnXVTjjgc6ap+dGboHpFZ+dlgC0HOTaC1RYC1xNNJXeBiUtZtTM6v3q 9FtirHM6ZtSKOKSkG4A+6AUtZ9boLPJ6dp12gs93N9YrL8H6Q8mlFAlAlpfnS6Z7HufO7L3 AvPGo2zf8bfw5Oa8IiibA== X-UI-Out-Filterresults: notjunk:1;V03:K0:iB7oetm4dOM=:dYmKu/q47L+l5aAZynqtjy EXljYHy/MQcwPkvDGebPScK8bbD4jJE70GJn56H6OfZS3UC41SjTw2QNhJw7UHj82ma4XY925 JlaGUCwbDsF4uk5dI+SvQZ170YhQ2+osWmH/qTJxKUXsbL9wSd4VAhO7q/G8vEETDRJYEkKzd T3xobpDfZlBVcYgRvaR1aKudq/Ag3CK5qR3GOTeRBEK/BU+0udis4wKsyEtp3+tbTljJg15Qj zNJv149qcoZzjHF6tWSxzaiXliXAJCuvP8eX4e6nqpnbIcMu6UpWYvhumgFluI25rtcAJhTxv hy8q53yQqsFiyfrc/xUTM6GJXQKIS0eQ+3R43CelWc52p+ymGWIVjBA1J7GmjtgooyWjSCzvx m/SX1W8g8qgpWzbfXNoAiRo4Or3wVDSOEowIJn6bt/BJS7oEy2fBSrKzzKo4WTxJPymdPWuyx UfHgX3QTlMVsVuKU2BJ4sQSeMYS3RPDV49vChH41obJQmI9n1klqawiocHuXVH2WePidRzQ4q iNKDfoKvjpsAZTxCrs6cQi6c7Kyr4ndC10Ge5IhmHAwh24yDfWxe6xjhhGHUPlPZra6VhqfMy XFsAgkes3zBTUiYM3iYbza/iejnuqZHWkzSSkSLJpNobaKRpQBUnu2wDV8jGn5xYZLqqBqrwv WH9LfZM3iWzdrdkqjZ3lsdW50lTo4iZZVFFdT08q6ynAtQz3ivYdNiVa/2muuXvM/gA0voL0S ZKkVjlaF6Lut/8jGWDpANw+lx+RwccBfzHNMZR14WLnETsi91+G3NucdgHAVjhFaSnZSG+yW 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:171733 Archived-At: > Again, the mode-line-prettifiers are not the ones who create new buffers > and then call fit-buffer-to-window. It's arbitrary other packages that > do that. An optional argument therefore would not help because when one > of the prettifier modes is active, then each and every third-party > caller of fit-buffer-to-window would have to pass that optional > argument. I see. Maybe a function 'set-default-mode-line-format' would be useful here. Anyway: At the time you prettify a mode line or show a new buffer in a window with a to be prettified mode line, would doing an immediate redisplay work around future problems? > This is the advice I currently use: > > (defvar-local moody--size-hacked-p nil) > > (defun moody-redisplay (&optional _force &rest _ignored) > (unless moody--size-hacked-p > (setq moody--size-hacked-p t) > (redisplay t))) > > (advice-add 'fit-window-to-buffer :before #'moody-redisplay) > > Of course fit-buffer-to-window itself could be changed to do that and it > could also be taught to only do so iff the user opted in to doing it. If we don't want 'fit-window-to-buffer' to do that always we'd need some variable, either buffer local or even a window parameter, that 'fit-window-to-buffer' would inspect once and reset immediately in order to perform only the redisplay call that's really needed. > Creating and displaying a new buffer and creating and resizing a new > window surely *already* causes a "redisplay" without the programmer > having to explicitly call `redisplay'. So if we explicitly tell > fit-window-to-buffer to redisplay, then that means that we are > redisplaying twice, right? I think so. Maybe 'fit-window-to-buffer' could use the string returned by 'format-mode-line' instead and calculate its height without redisplaying anything. martin