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 #35 received at 63825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eshel Yaron <me <at> eshelyaron.com>
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 08:44:42 +0300
> From: Eshel Yaron <me <at> eshelyaron.com>
> Cc: sbaugh <at> janestreet.com,  63825 <at> debbugs.gnu.org
> Date: Fri, 02 Jun 2023 21:53:45 +0300
> 
> Regarding this comment:
> 
> >> +/**
> >> + * null_header_line_format:
> >> + *
> >> + * Return 1 when header line format F indicates that the header line
> >> + * should not be displayed at all.
> 
> > We usually say "Return non-zero", not 1.
> 
> I've changed the wording accordingly, note that some other functions
> that return `bool` in src/window.c currently say "Return 1",
> e.g. `window_wants_header_line`.

Yes, those are leftovers from when those functions returned an 'int',
not a 'bool', i.e. when we didn't require a C99 compiler.

> Sure, here's the new patch:

Thanks.

>  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.

> +  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.




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.