all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63825@debbugs.gnu.org, Eshel Yaron <me@eshelyaron.com>
Subject: bug#63825: 29.0.90; The header line should be hidden when empty
Date: Thu, 01 Jun 2023 16:22:14 -0400	[thread overview]
Message-ID: <ierv8g7ylu1.fsf@janestreet.com> (raw)
In-Reply-To: <83353bc97b.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Jun 2023 21:46:00 +0300")

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: Spencer Baugh <sbaugh@janestreet.com>,  63825@debbugs.gnu.org
>> Date: Thu, 01 Jun 2023 19:45:39 +0300
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > header-line-format supports :eval and :when, so why cannot
>> > which-function-mode use those to yield nil when there's nothing to
>> > show?
>> 
>> I thought so as well, but it seems that the header line is displayed
>> even when the value of `header-line-format` yields nil, if it isn't
>> plain nil.
>> 
>> So this shows an empty header line:
>> 
>> --8<---------------cut here---------------start------------->8---
>> (setq-default header-line-format '(:eval nil))
>> --8<---------------cut here---------------end--------------->8---
>> 
>> (In Emacs master with -Q.)
>
> It shouldn't be hard to make this special case behave as you want.
> Specifically, if the header-line-format is just a single cons cell,
> and the car of that cons cell is either :eval or a symbol, and the
> result of evaluation those yields nil, don't display the header line.
> (I don't really like the idea of not displaying the mode line under
> the same conditions.)
>
> Patches welcome.

Ok, the easy way to achieve that is to run format-mode-line on the
header-line-format and if it evaluates to "", don't display the header
line.  That also ignores the cases where header-line-format is multiple
cons cells, all of which evaluate to nil, and other such scenarios.  Is
that an acceptable approach to you?





  reply	other threads:[~2023-06-01 20:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 13:37 bug#63825: 29.0.90; The header line should be hidden when empty Spencer Baugh
2023-06-01 16:14 ` Eli Zaretskii
2023-06-01 16:45   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-01 17:37     ` Spencer Baugh
2023-06-01 18:46     ` Eli Zaretskii
2023-06-01 20:22       ` Spencer Baugh [this message]
2023-06-02  6:19         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-02 11:36           ` Eli Zaretskii
2023-06-02 18:53             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03  5:44               ` Eli Zaretskii
2023-06-03  7:28                 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04  7:03                   ` Eli Zaretskii
2023-06-04 16:45                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-06 12:18                       ` Eli Zaretskii
2023-06-06 12:28                         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-02  6:23         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierv8g7ylu1.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=63825@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.