GNU bug report logs - #63825
29.0.90; The header line should be hidden when empty

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Thu, 1 Jun 2023 13:38:01 UTC

Severity: normal

Found in version 29.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eshel Yaron <me <at> eshelyaron.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com, 63825 <at> debbugs.gnu.org
Subject: Re: bug#63825: 29.0.90; The header line should be hidden when empty
Date: Sat, 03 Jun 2023 10:28:20 +0300
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>>  For example, @code{(format-mode-line header-line-format)} returns the
>> -text that would appear in the selected window's header line (@code{""}
>> -if it has no header line).  @code{(format-mode-line header-line-format
>> -'header-line)} returns the same text, with each character
>> -carrying the face that it will have in the header line itself, and also
>> -redraws the header line.
>> +text that would appear in the selected window's header line.
>> +@code{(format-mode-line header-line-format 'header-line)} returns the
>> +same text, with each character carrying the face that it will have in
>> +the header line itself, and also redraws the header line.
>
> I'm not sure why you removed the part about an empty string.  There's
> no change in format-mode-line to justify that, AFAICT, and neither
> should there be.

Indeed, my patch doesn't change `format-mode-line`.  I removed this part
because AFAICT it's wrong: it suggests that if `format-mode-line`
returns the empty string with some argument, then using that argument as
the value of `header-line-format` will result in no header line at all.
But that's not the case (and it wasn't before my patch), because
`(format-mode-line header-line-format)` returning an empty string means
that the header line is either absent or empty, not necessarily absent.

>> +  if (CONSP (fmt))
>> +    {
>> +      car = XCAR (fmt);
>> +      if (SYMBOLP (car))
>> +	{
>> +	  if (EQ (car, QCeval)
>> +	      && NILP (Feval (XCAR (XCDR (fmt)), Qnil)))
>> +	      return true;
>
> This should use safe__eval (or something similar), not Feval, because
> it is called as part of redisplay, where we cannot allow any errors to
> throw to top-level.

Got it, here's an updated patch:

[v2-0001-Avoid-header-line-with-some-empty-non-nil-formats.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Best,

Eshel

This bug report was last modified 1 year and 346 days ago.

Previous Next


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