Eli Zaretskii writes: >> From: Elijah Gabe Pérez >> 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.