From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.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 Oct 2021 09:55:21 +0200 Message-ID: References: <87eeyd3ul0.fsf@bernoul.li> <2a0bf8c7-69df-0532-c6d8-5315ee9fee28@gmx.at> <67bcd8c4-2028-46bb-7971-244304bb7c0a@gmx.at> <776a35b7-1920-2987-88ae-6dcab958a8e4@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21754"; mail-complaints-to="usenet@ciao.gmane.io" To: Carlos Pita , 38181@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 16 09:56:17 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbeYC-0005T2-KH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Oct 2021 09:56:16 +0200 Original-Received: from localhost ([::1]:42166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbeYA-0002Oy-SU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Oct 2021 03:56:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbeXx-0002BS-Vl for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 03:56:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbeXx-0003wq-Mv for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 03:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mbeXx-00079f-IU for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 03:56:01 -0400 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 Oct 2021 07:56:01 +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.163437093327466 (code B ref 38181); Sat, 16 Oct 2021 07:56:01 +0000 Original-Received: (at 38181) by debbugs.gnu.org; 16 Oct 2021 07:55:33 +0000 Original-Received: from localhost ([127.0.0.1]:40915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbeXU-00078w-PQ for submit@debbugs.gnu.org; Sat, 16 Oct 2021 03:55:33 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:39311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbeXQ-00078g-RG for 38181@debbugs.gnu.org; Sat, 16 Oct 2021 03:55:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1634370922; bh=9gBQ0c6xjzeoRvo1vf/boIWD0EIRYCrTMgEvBTHtho0=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=Ppj25iMy4FrvbCF5j8+4sZRyihvKaPPlKu2mEBPgGK64XZbox0EpP9LPYMraOxKju RQBju2bMdyvaqNAdK0+24ttWWDvbUpn7VX/oXqiLLi/Bpf8vee/+SamXKx12TYGZm/ hb4b5WFYvi6MhLhPvRFQRuF+bTMqG36J697zsEjY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.102] ([212.95.5.98]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuDc7-1msMTP0fPR-00uVsv; Sat, 16 Oct 2021 09:55:22 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:NT/+7gXbqphwUmC/V5e3JEM5BaYWR+ft+DniughhLU3YWofaPcX T+XsjlD/ZYAuWbN1Hj/MnoFXVsZXTfHKLquxXH75fsBtbB9E8kotLi0F76ZAxieBDbmcl0F lLkgYpaWfsNkcg4h2cN+g+w4zewGdRSt34os8stxDErlvLGMkTZqDYBfo9OGPIbAhQMxiVy 140gjJoaJufIjuknp/4Nw== X-UI-Out-Filterresults: notjunk:1;V03:K0:KekYd5pi4I0=:fVofbIA95ojBWfswm118bB DYX73roCqDaqhqRkR5WVvlfnTmjLaWRPZX+lE28JnQXcOwfIIj+lvanDeWoX5l508hdYwyz1B 3MBbijhDq8kLZ8XQjiRa5H13WHvQ+b0trpcl+pl0GrZXzApG0BEcHp0BuHFsyh1V9wDzxObyb PA2TV3Juh+oC4BSUMcbTyngJkQ99TbqVDVtJa5OhwmA7IAltO4RN6YU5GUvQ9xJXu/if+rRPn G8Pp2gUpcs1MUDWjCM+VvenS+A/cUQcY9ibsmmqnTOdUJPCioYgycdyOLXS310Wu6u8pQ3Ycy iAhleDXvivosCG0sP/4cUUfoTzx5COElFE5+j1SU0N4AKWFm5XipSZZrBUNjp2c/cnT/5sA12 cdfZRtseXeA1vh8lsU7C3q2UQSqwnbMJfJV6F002xU3MC8FhyVjhB3QGW0FlEkPm2/wjrgO8f 6zdbdV/ipLQOc+2YQU2T6mUTVDdh7uFfcEcd8Y7s3q0XQUzkxAmsIOZp6VCqxMSFtM67pMLAU YwXXsyZnC/HfsV901fBQgfqS1eMmOAQE9YbYpVP70zranJQU38VPWmcTMTrjBTptzT5MvgxiD 0Z6zNCVEI21d5I1CNVqt4ut1DswyHFO8CC0tx1bSNNFeBAsibdKh4CTfjaqMybl39EHTKp1i0 LDxz2fDv64eIovuvG5QKZuYRwk6sInm2rPUWfnY0anbW306QetvD92xugitgPwFkWoplGQyIx vAZhu95Jvr6htjQzAHmxLgmsNzLvfUx8RD5T9coS14Gxq/nhBgmVoPoG13KS7DFEY95mcuwm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217354 Archived-At: >> > 2. redisplay fit redisplay fit redisplay ... > >> Sorry. I still don't understand the purpose of the last redisplay here. > > It's not the last, it's a repeating sequence, I left the dangling > redisplay instead of ending it in a fit because I was explaining my > unfortunate choice of words when I said "after", but it's formally the > same, the point being that the first redisplay is not enough. OK. Can we settle on something like 2. redisplay fit redisplay fit redisplay ... fit Bear with me but I'm trying to simultaneously understand what you are doing and what Emacs is doing. This is multitasking and I'm bad at that. >> Does >> >> 2. redisplay fit redisplay fit ... >> >> fail? What are the values returned by 'window-mode-line-height' after >> each redisplay? > > As far as I can see this works, What is "this" here? > as I said before. In the example > provided by Jonas window-mode-line-height is 29 immediately after > calling set-face-attribute, but after setting mode-line-format it's > always 60, no matter if I call redisplay or fit or none of them or in > what order. But even if the reported height is the same, the layout is > not, omitting the (previous) redisplay always crops the text. I'm currently not even sure what we are comparing here. Let's settle on the following idioms: (defun selected-window-mode-line-height () (pos-visible-in-window-p t nil t) (window-mode-line-height)) (let ((val (selected-window-mode-line-height))) (fit-window-to-buffer) (cons (selected-window-mode-line-height) val)) Do you see any change in the return value here? And when you run this repeatedly as in the redisplay fit redisplay fit redisplay ... fit scenario? And with 'set-face-attribute' and setting 'mode-line-format' intermingled? Maybe Emacs sometimes doesn't cache the result of an earlier call of display_mode_line although it could (or should). martin