Subject: Re: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'

From: Eli Zaretskii <[email-masked]>
Date: Tue, 24 Jun 2025 14:18:11 +0300

> From: Elijah Gabe Pérez <[email-masked]>
> Date: Mon, 23 Jun 2025 13:20:44 -0600
> 
> This new command allows toggle the mode line visibility in the current
> buffer.
> 
> The mode line keeps hidden from each major mode change, avoiding having
> to run this command many times.
> 
> This is based/inspired by `hide-mode-line-mode` (from MELPA), but unlike
> latter one, this is a rewrite which uses a command instead a minor mode
> and I'm interested in including this in Emacs :^).

Thanks.  I think the idea of a minor mode is better.  Our experience
is that many toggle commands end up being minor modes.  One advantage
of a minor mode is that the ways of turning a mode on/off and toggling
it are automagically done for you, and they are all uniformly familiar
to users.

> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -346,6 +346,14 @@ This option allows changing or removing the delimiters shown around
>  the major mode and list of minor modes in the mode line.  The default
>  retains the existing behavior of inserting parentheses.
>  
> +---
> +*** New command 'toggle-mode-line-visibility'.
> +This command toggles the mode line visibility in current buffer, if the
> +current buffer displays a mode line, this will temporally hide it until
> +'toggle-mode-line-visibility' is called again.  Otherwise, if the
> +current buffer does not have a mode line by default, this will display
> +one.

This feature must be described in the user manual, so please add the
necessary changes for that (and mark the NEWS entry with "+++").

> +(defun toggle-mode-line-visibility (&optional hide-only)
> +  "Toggle mode line visibility in current buffer.
> +If current buffer displays a mode line, temporally hide it until
                                           ^^^^^^^^^^
"temporarily"

> +The mode line is hidden from every major mode change in current buffer.

This sentence confused me.  What did you mean to say here?

> +If HIDE-ONLY is non-nil, only hide the mode-line."

What is the difference between "only hide" and the other situation?
Please clarify.

> +;; NOTE: This function is intended to be used in hooks.
> +(defun disable-mode-line ()

If you make this a minor mode, you won't need two functions, one will
do.

Thanks.