GNU bug report logs -
#78881
[PATCH] New command 'toggle-mode-line-visibility'
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78881 in the body.
You can then email your comments to 78881 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Mon, 23 Jun 2025 19:22:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Elijah Gabe Pérez <eg642616 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 23 Jun 2025 19:22:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tags: patch
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 :^).
[0001-New-command-toggle-mode-line-visibility.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Tue, 24 Jun 2025 11:19:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Tue, 24 Jun 2025 17:05:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 78881 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
>> 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.
I agree, but the problem with making this command a minor mode is that
it have to check whether the minor mode variable is non-nil for
display/hide the mode-line (AFAIU), this brings problems because if a
buffer by default does not show the mode line, one would have to execute
the command twice to display it.
This would also create 2 variables of which I do not see much use: the
minor mode hook and minor mode variable.
Anyway, I changed it to a minor mode, but I am not very convinced of the
result.
>> --- 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 "+++").
Sure, but I'm not sure in which section of the manual I must document
it, maybe in "Optional Mode Line Features" from "emacs" manual?
>> +The mode line is hidden from every major mode change in current buffer.
>
> This sentence confused me. What did you mean to say here?
e.g. If you call `toggle-mode-line-visibility` in the scratch buffer and
later call `text-mode` in the same buffer, the mode line will become
visible again, which is not convenient since this command is meant to
enable/disable the mode line per buffer, not per major mode.
>> +If HIDE-ONLY is non-nil, only hide the mode-line."
>
> What is the difference between "only hide" and the other situation?
> Please clarify.
It was only for internal use of the command, for ensure that the mode
line is hidden because this command can display it if the mode line is
already hidden, that's why `disable-mode-line` existed.
[0001-New-command-toggle-mode-line-visibility.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Wed, 25 Jun 2025 11:10:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: 78881 <at> debbugs.gnu.org
> Date: Tue, 24 Jun 2025 11:04:35 -0600
>
> > 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.
>
> I agree, but the problem with making this command a minor mode is that
> it have to check whether the minor mode variable is non-nil for
> display/hide the mode-line (AFAIU), this brings problems because if a
> buffer by default does not show the mode line, one would have to execute
> the command twice to display it.
I don't understand why you'd need to invoke the command twice.
> This would also create 2 variables of which I do not see much use: the
> minor mode hook and minor mode variable.
Isn't that so with every minor mode we have?
> >> +---
> >> +*** 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 "+++").
>
> Sure, but I'm not sure in which section of the manual I must document
> it, maybe in "Optional Mode Line Features" from "emacs" manual?
Yes, that's the right place.
> >> +The mode line is hidden from every major mode change in current buffer.
> >
> > This sentence confused me. What did you mean to say here?
>
> e.g. If you call `toggle-mode-line-visibility` in the scratch buffer and
> later call `text-mode` in the same buffer, the mode line will become
> visible again, which is not convenient since this command is meant to
> enable/disable the mode line per buffer, not per major mode.
So you want to say this:
Changing the major mode will not display the hidden mode line.
Or maybe simply remove this part: why would someone assume that
another major mode will override this? If they won't expect that,
you don't have to explain that it won't happen.
> +(define-minor-mode toggle-mode-line-visibility
> + "Toggle mode line visibility in current buffer.
I don't see why "toggle" should be in the name. How about
mode-line-invisible-mode ? or hide-mode-line-mode ?
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Wed, 25 Jun 2025 19:01:05 GMT)
Full text and
rfc822 format available.
Message #17 received at 78881 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
[...]
>> >> +The mode line is hidden from every major mode change in current buffer.
>> >
>> > This sentence confused me. What did you mean to say here?
>>
>> e.g. If you call `toggle-mode-line-visibility` in the scratch buffer and
>> later call `text-mode` in the same buffer, the mode line will become
>> visible again, which is not convenient since this command is meant to
>> enable/disable the mode line per buffer, not per major mode.
>
> So you want to say this:
>
> Changing the major mode will not display the hidden mode line.
>
> Or maybe simply remove this part: why would someone assume that
> another major mode will override this? If they won't expect that,
> you don't have to explain that it won't happen.
Agree, I've removed that part.
>> +(define-minor-mode toggle-mode-line-visibility
>> + "Toggle mode line visibility in current buffer.
>
> I don't see why "toggle" should be in the name. How about
> mode-line-invisible-mode ?
Fine, I've renamed it to `mode-line-invisible-mode`.
> or hide-mode-line-mode ?
I would have liked to use that name, but there is already a package that
has it. So I prefer to avoid potential bugs due to the name.
[0001-New-command-mode-line-invisible-mode.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 28 Jun 2025 10:07:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: 78881 <at> debbugs.gnu.org
> Date: Wed, 25 Jun 2025 13:00:35 -0600
>
> +@findex mode-line-invisible-mode
> + By default, most buffers display a mode line, however not in many
> +cases the mode line may be useful,
I'd rephrase: "..., but if the mode line is not useful in a buffer,..."
> you can use the command @kbd{M-x
> +mode-line-invisible-mode} to hide the mode line in the current buffer,
Please enclose long "M-x command-name" in @w{..}, so that makeinfo
doesn't break that between two lines. Like this:
...you can use the command @w{@kbd{M-x mode-line-invisible-mode}}
> +the mode line remains hidden until this command is called again. To
> +always hide the mode line when entering to a major mode, add
> +@code{mode-line-invisible-mode} to a hook @xref{Hooks}.
^^^^^^^^^^^^
@xref should only be used at the beginning of a sentence, since it
produces a capitalized "See". Here you want @pxref (in parentheses).
Alternatively, you could have a period after "to a hook", in which
case @xref will be the next sentence.
> ++++
> +*** New minor mode 'mode-line-invisible-mode'.
> +This command hide temporarily the mode line in current buffer until
> +'mode-line-invisible-mode' is called again.
Why "temporarily"?
I would rephrase this:
This command toggles the mode-line visibility of the current buffer:
hides it if it is shown, and shows it if it's hidden.
> +(define-minor-mode mode-line-invisible-mode
> + "Hide temporarily the mode line in the current buffer.
> +Hide the mode line in current buffer until this minor mode is called
> +again."
Same here.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 28 Jun 2025 18:37:05 GMT)
Full text and
rfc822 format available.
Message #23 received at 78881 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
[...]
> Why "temporarily"?
>
> I would rephrase this:
>
> This command toggles the mode-line visibility of the current buffer:
> hides it if it is shown, and shows it if it's hidden.
Thanks, sending fixed patch:
[0001-New-command-mode-line-invisible-mode.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 05 Jul 2025 08:38:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Elijah Gabe Pérez <eg642616 <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 05 Jul 2025 08:38:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 78881-done <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: 78881 <at> debbugs.gnu.org
> Date: Sat, 28 Jun 2025 12:36:47 -0600
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> [...]
>
> > Why "temporarily"?
> >
> > I would rephrase this:
> >
> > This command toggles the mode-line visibility of the current buffer:
> > hides it if it is shown, and shows it if it's hidden.
>
> Thanks, sending fixed patch:
Thanks, installed on the master branch, and closing the bug.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 05 Jul 2025 10:36:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> Resent-To: bug-gnu-emacs <at> gnu.org
> Cc: 78881-done <at> debbugs.gnu.org
> Date: Sat, 05 Jul 2025 11:37:48 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> > Cc: 78881 <at> debbugs.gnu.org
> > Date: Sat, 28 Jun 2025 12:36:47 -0600
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > [...]
> >
> > > Why "temporarily"?
> > >
> > > I would rephrase this:
> > >
> > > This command toggles the mode-line visibility of the current buffer:
> > > hides it if it is shown, and shows it if it's hidden.
> >
> > Thanks, sending fixed patch:
>
> Thanks, installed on the master branch, and closing the bug.
Sorry, I needed to revert that, because these changes failed the
bootstrap.
We cannot call define-minor-mode in bindings.el, because bindings.el
is loaded by loadup.el before loaddefs.el, and so define-minor-mode is
not yet known as an autoloaded macro.
One solution is to move the code to simple.el instead. Stefan, do we
have something better, assuming we want this to live in bindings.el
for some reason?
Please in the future always test your changes by "make bootstrap", to
avoid problems of this kind.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 05 Jul 2025 14:58:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> One solution is to move the code to simple.el instead. Stefan, do we
> have something better, assuming we want this to live in bindings.el
> for some reason?
Can't think of a good reason why this needs to be in `bindings.el` or
why it would be ill-at-ease in `simple.el`, so yeah I'd move it there.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 05 Jul 2025 20:46:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 78881 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
> Sorry, I needed to revert that, because these changes failed the
> bootstrap.
>
> We cannot call define-minor-mode in bindings.el, because bindings.el
> is loaded by loadup.el before loaddefs.el, and so define-minor-mode is
> not yet known as an autoloaded macro.
>
> One solution is to move the code to simple.el instead.
Fine, I've moved it to simple.el, see patch below:
[0001-New-command-mode-line-invisible-mode.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
> Please in the future always test your changes by "make bootstrap", to
> avoid problems of this kind.
Thanks, and sorry for the inconvenience.
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#78881
; Package
emacs
.
(Sat, 12 Jul 2025 07:52:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 78881 <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 78881 <at> debbugs.gnu.org
> Date: Sat, 05 Jul 2025 14:45:12 -0600
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Sorry, I needed to revert that, because these changes failed the
> > bootstrap.
> >
> > We cannot call define-minor-mode in bindings.el, because bindings.el
> > is loaded by loadup.el before loaddefs.el, and so define-minor-mode is
> > not yet known as an autoloaded macro.
> >
> > One solution is to move the code to simple.el instead.
>
> Fine, I've moved it to simple.el, see patch below:
Thanks, now installed on master.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 09 Aug 2025 11:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 41 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.