GNU bug report logs - #38181
Actual height of mode-line not taken into account

Previous Next

Package: emacs;

Reported by: Jonas Bernoulli <jonas <at> bernoul.li>

Date: Tue, 12 Nov 2019 16:54:01 UTC

Severity: normal

Fixed in version 29.1

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


Message #224 received at 38181 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Carlos Pita <carlosjosepita2 <at> gmail.com>, 38181 <at> debbugs.gnu.org
Subject: Re: bug#38181: Actual height of mode-line not taken into account
Date: Sat, 16 Oct 2021 09:55:21 +0200
>>   > 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




This bug report was last modified 3 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.