GNU logs - #78881, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 23 Jun 2025 19:22:01 +0000
Resent-Message-ID: <handler.78881.B.175070646729807 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 78881 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.175070646729807
          (code B ref -1); Mon, 23 Jun 2025 19:22:01 +0000
Received: (at submit) by debbugs.gnu.org; 23 Jun 2025 19:21:07 +0000
Received: from localhost ([127.0.0.1]:57888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTmj4-0007kX-0c
	for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:07 -0400
Received: from lists.gnu.org ([2001:470:142::17]:59504)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uTmiz-0007hw-4E
 for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmio-0007E2-NH
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:52 -0400
Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmim-0006cU-KA
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:50 -0400
Received: by mail-oi1-x241.google.com with SMTP id
 5614622812f47-40af40aee93so101833b6e.0
 for <bug-gnu-emacs@HIDDEN>; Mon, 23 Jun 2025 12:20:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1750706446; x=1751311246; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=UvoseClBOsUsnHFb7VLHXlbCUp/peRSHBRPClt9E5Kk4k37PhUYyLbguXJZabbPyJB
 UA0jD4vY2OU1kbRBNQMjdN011AMeBda9sIC7vn/BLkadidvsORC6qvS6i5vJJqub2s0w
 BxggQBxby8aJdPts6C8F+EetO7qVV5E53/7QhXHctGavwVXt6VNPki83eMeih4OH6NNW
 6tXlBGlD6l/eRMcbFdZpwZJ39CuYRXqM66UDoanawsbC5frrUtr1DPNJ/vbNw2rl39Yr
 vbHRbOD5+AAQOS/AYW7bDdlaCNH6MzAtIkHt+6qyACLPFX347GSpfClC84hx9Y/XV5v/
 kvHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1750706446; x=1751311246;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=NcHUherBHOYmEUoBmgzHSMkEX22HlnzFjC4poclJUZjYY5bgjc2fLEKPT6fcH9WlpV
 FrfoTBpdif2XHLe8rlKi6eopG6SNwsHEcZ2vTPZYfnIY88BOWf232aI0waSXOSEZlWus
 WU3HVIzJtecxsVOENx9JGdiZmlfrhC3G35JAFUfPhXzfLM8IhEVaoKtV9oNZYNf1w5ks
 T8FiQVApN+uZgarwiZAnnR2KrgPMgx+lP0TD/nxnVIFnvUzH5gwyqgqKcUalVFtY9n/G
 S4Erb74GYuLMWJcs6nMenKK8IUsQZ0kwUiesyXYF9P2cD/c0su7sS6+amulHke7CU8Ep
 61xA==
X-Gm-Message-State: AOJu0YyvXA0ZXoq60xjZJBRAacO1Q+pUd3g/WPWklE36j+xA2k3qgHmX
 NVcCfyOAvgxhViZSBwWH1c1Ny92be2ZuzbQA1q1SY3S5lvP0IPtx8P9oD/C6T+o1
X-Gm-Gg: ASbGncvsfq/QtzV96zELCO4tElfrcRsbXZ/xMhDH9IVFopvmKr4Px/30G9jxSNOo6uG
 5ndTLq/OoxzdAAA1/L1EZWoslnioiix/xiYcD7yWeferp+xnX2wC9WRbUABxJUflQoWKJ9FcOJF
 3EGBQlESUjqIe5pib+WDcF7llAro0WP6RyxI/EQ3G//22TdusM9XR3FWdBzr4XmvpZPHtRh0VLN
 bPFWklbAAaBGlstYwstGgXFIYChLu9ZUGX8cjDFLth2mK3ze49rUsO65K/XE1OhknfaH4dxmuVS
 b0vdkecTKtawfIl7hgzeYiRyK2xSbQ==
X-Google-Smtp-Source: AGHT+IFXZ6TF1NRB+AZi452cVb6heDGKSCO2ZPW/QMXVsSQxdKBpD3JZ+V7yAkAPITpvHiiV7izRHQ==
X-Received: by 2002:a05:6808:220b:b0:402:862:93ae with SMTP id
 5614622812f47-40ac6f526ebmr10524796b6e.16.1750706446313; 
 Mon, 23 Jun 2025 12:20:46 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-40ac6d11bacsm1516980b6e.35.2025.06.23.12.20.45
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 23 Jun 2025 12:20:45 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 13:20:44 -0600
Message-ID: <8734bqz2lv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::241;
 envelope-from=eg642616@HIDDEN; helo=mail-oi1-x241.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: 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. 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

--=-=-=
Content-Type: text/plain

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 :^).


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-New-command-toggle-mode-line-visibility.patch

From a3c36ce32da275a6213e28a8feb3abe1b27ba87a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'toggle-mode-line-visibility'

This new command allows toggle the mode line visibility in the
current buffer.  (Bug#)

* etc/NEWS: Announce changes.
* lisp/bindings.el (toggle-mode-line--buf-state): New buffer
local variable.
(toggle-mode-line-visibility): New command.
(disable-mode-line): New function.
---
 etc/NEWS         |  8 ++++++++
 lisp/bindings.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 6f3d28d0e03..c9de3feae63 100644
--- 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.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..6c7d47dcd4a 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,52 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `toggle-mode-line-visibility' for
+;; store mode-line value in current buffer.
+(defvar-local toggle-mode-line--buf-state)
+
+(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
+`toggle-mode-line-visibility' is called again.  Otherwise, display one
+if the buffer does not have a mode line by default.
+
+The mode line is hidden from every major mode change in current buffer.
+
+If HIDE-ONLY is non-nil, only hide the mode-line."
+  (interactive "^P")
+  (if mode-line-format
+      (progn
+        ;; Hook to prevent the mode line from being displayed again at
+        ;; each change of major mode.
+        (add-hook 'after-change-major-mode-hook #'disable-mode-line nil t)
+        (setq toggle-mode-line--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (unless hide-only
+      (remove-hook 'after-change-major-mode-hook #'disable-mode-line t)
+      (setq toggle-mode-line--buf-state
+            (buffer-local-restore-state toggle-mode-line--buf-state))
+
+      ;; Display a mode line if buffer does not have one by default.
+      (unless mode-line-format
+        (setq-local mode-line-format (default-value 'mode-line-format)))
+
+      ;; Update mode line.
+      (when (called-interactively-p 'any)
+        (force-mode-line-update)))))
+
+;; NOTE: This function is intended to be used in hooks.
+(defun disable-mode-line ()
+  "Hide the mode-line in current buffer.
+The mode line is hidden from every major mode change in current buffer.
+
+See `toggle-mode-line-visibility'."
+  (toggle-mode-line-visibility 'hide))
+
+(put 'toggle-mode-line--buf-state 'permanent-local t)
+(put 'disable-mode-line 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: bug#78881: Acknowledgement ([PATCH] New command 'toggle-mode-line-visibility')
Message-ID: <handler.78881.B.175070646729807.ack <at> debbugs.gnu.org>
References: <8734bqz2lv.fsf@HIDDEN>
X-Gnu-PR-Message: ack 78881
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 78881 <at> debbugs.gnu.org
Date: Mon, 23 Jun 2025 19:22:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 78881 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
78881: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78881
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 24 Jun 2025 11:19:01 +0000
Resent-Message-ID: <handler.78881.B78881.17507639105791 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.17507639105791
          (code B ref 78881); Tue, 24 Jun 2025 11:19:01 +0000
Received: (at 78881) by debbugs.gnu.org; 24 Jun 2025 11:18:30 +0000
Received: from localhost ([127.0.0.1]:41337 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uU1fZ-0001VJ-Ma
	for submit <at> debbugs.gnu.org; Tue, 24 Jun 2025 07:18:30 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34586)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uU1fX-0001UO-1P
 for 78881 <at> debbugs.gnu.org; Tue, 24 Jun 2025 07:18:27 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uU1fK-00088W-0V; Tue, 24 Jun 2025 07:18:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=h9b6cy+HDa7O9LnRD6kgqntzFFn24wp8sibQabTZCgc=; b=ixXCfwSgrpuTDPPv09qX
 vc8u84Kg4jfxZJz4kLV9LDgKNoxjsL1tbQ9EA4pM1TKm0TfpmgCmx9sLCn7K1YgPlfVNrTQzTvjfB
 6Fm8RPfr/W7TGNz3frfJ4BuDRp+LHfmlNkA1vMfulGtSuMSZUXiiETYuno4o/veBKcwmOT9bF5PEf
 uXA//7FeNrh54uO1LbgNYbnz3D8TPPeViQEOe2vm/J69+OcBjKfLE4xMR8HrZOxwvFMqZzK/UMtVl
 f4ciQUA0AHeU53xXaMxMjPqOJ5t8mPPM+yeVPU8vONb5hTE0MekJB3SSZ/GmlmSVt65WdYQBa5Ax4
 sJvX/tgDN1aIIg==;
Date: Tue, 24 Jun 2025 14:18:11 +0300
Message-Id: <86zfdxe6bw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <8734bqz2lv.fsf@HIDDEN> (message from Elijah Gabe
 =?UTF-8?Q?P=C3=A9rez?= on Mon, 23 Jun 2025 13:20:44 -0600)
References: <8734bqz2lv.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> 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.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 24 Jun 2025 17:05:02 +0000
Resent-Message-ID: <handler.78881.B78881.175078468724774 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175078468724774
          (code B ref 78881); Tue, 24 Jun 2025 17:05:02 +0000
Received: (at 78881) by debbugs.gnu.org; 24 Jun 2025 17:04:47 +0000
Received: from localhost ([127.0.0.1]:47114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uU74g-0006RS-Vl
	for submit <at> debbugs.gnu.org; Tue, 24 Jun 2025 13:04:47 -0400
Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:49290)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uU74e-0006Qw-6h
 for 78881 <at> debbugs.gnu.org; Tue, 24 Jun 2025 13:04:45 -0400
Received: by mail-ot1-x343.google.com with SMTP id
 46e09a7af769-73a8d0e3822so379373a34.2
 for <78881 <at> debbugs.gnu.org>; Tue, 24 Jun 2025 10:04:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1750784678; x=1751389478; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=3VsOx/F6ows3yrjr86g9U8ICKllJKDBwOlk/XEO5p8w=;
 b=egq5WDrNNiO38b2zFRErkL4pVE1X3W/HjXWe/V2f7gsKX/6IqQaUYdmt8gmyeLN+1M
 BAHNV9aLGRz1kwxxrP6GcBoccsprqa+M/AMdsO32VMPHLviGG1Bf1264JWCkvHtPu7rE
 mssgbhduvSc+c8t4waK+soQ3YBx+lSSntMgcoI3g2BgZZjjzqZjn9UjiZtH0d9n8k2yy
 NH9lQWZ7xx0DX8Te2CqSCidbmeGPni2OuE24NSzoTic5aiVPDgokPaX7QE3taYW1MMcv
 jmRRditS9zpZnn7AI764jcAKMzopIg8nPq+4NuJm1dA47t7VXsX3tmpRo+2KDNbeiEB9
 27lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1750784678; x=1751389478;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=3VsOx/F6ows3yrjr86g9U8ICKllJKDBwOlk/XEO5p8w=;
 b=oLVgrcrT9M+bKEu45xuTYPKVHBOz9GOKHbITxEo/10RbWzwzZZfGqdFTmoU31q3MaU
 ZJ5mYH/VUoBL+J4gYhca6YtVED7eaxvugJE/FlZqKl5cx++XsLJ+4dXr2yGSOspijC4l
 KMwOK+SrLaMUA6Rh618pc/WxBL/GB3cRUfNnAvX/6U0cCTslU8bDiV/fOUiymbyz7gDT
 dcYV2JkC2gajJ9n8OUaaQYeavbjDitwb9EKqQjCS5Xt75KX9AP1jEB9uWj03Ow0Tqnwv
 rZvfqGyJNYTMjtLwNCg9PDv3FnIvtdKV0bQq7VRTB5wtcXQ8s3qCuFzfGNDdi8j716x4
 Ru1w==
X-Gm-Message-State: AOJu0YyuCgtNoxJKdXJKbNc3W5vmuR1r5PnQh4vtFyMaWVPt4X6d1aDS
 tdCiroWWEdMiJH+F64SHGVa4CwYZKEQrag45TyKzOeDFwQfLM117+0FcqJaXoxnr
X-Gm-Gg: ASbGnct8jAR8DYst8UsO4SDQM3z7Wdo/BvT0xakNhiVHLR9kF+UbfYOe5F5Pw02NcSs
 qKubPojsL5dO/qkysTEY+s7Kv8l1iwXSmL//nuhbRBTBZZq9ZRNoBolvK8IC7EbbJZZC2oBqepf
 oIgA1Rou4p3rbFvCc/1zkZoGmgm2gv9QtD5P8qEAbdIM5Pe+4iNXR0RCL5fHaQN3QiEUODDfOYv
 OO63e0VHTk31939gID2voDgyF4TndYNP+sPCOS4CcvPl8v7+xX1i9o6LFLxcI7VrCzBoFgmYmGB
 b+uSVzs0B/2mKouK1T4qk8AFJTH6mktIWdNyStAl
X-Google-Smtp-Source: AGHT+IEKJBNzbQsH6CZLRmNBVklepSIrWh7eksOrJAQG+QSVNodnPU1imyjbVCCSu45R6fCVCkGcgQ==
X-Received: by 2002:a05:6830:2814:b0:72b:9316:d596 with SMTP id
 46e09a7af769-73a91c0fa67mr12983803a34.3.1750784677771; 
 Tue, 24 Jun 2025 10:04:37 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-73a90b33a43sm1916969a34.29.2025.06.24.10.04.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Jun 2025 10:04:37 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <86zfdxe6bw.fsf@HIDDEN>
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
Date: Tue, 24 Jun 2025 11:04:35 -0600
Message-ID: <874iw5f4v0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Elijah Gabe P=C3=A9rez <eg642616@HIDDEN>
>> Date: Mon, 23 Jun 2025 13:20:44 -0600
>>=20
>> This new command allows toggle the mode line visibility in the current
>> buffer.
>>=20
>> The mode line keeps hidden from each major mode change, avoiding having
>> to run this command many times.
>>=20
>> 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 delimit=
ers shown around
>>  the major mode and list of minor modes in the mode line.  The default
>>  retains the existing behavior of inserting parentheses.
>>=20=20
>> +---
>> +*** 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.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-New-command-toggle-mode-line-visibility.patch

From 67cfb180079d761dbe08dd66a9eab64fe29e4d34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'toggle-mode-line-visibility'

This new command allows toggle the mode line visibility in the
current buffer.  (Bug#78881)

* etc/NEWS: Announce changes.
* lisp/bindings.el (toggle-mode-line--buf-state): New buffer
local variable.
(toggle-mode-line-visibility): New minor mode.
(toggle-mode-line--hide): New function.
---
 etc/NEWS         |  8 ++++++++
 lisp/bindings.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index f7aebdf538f..59c77f3abb0 100644
--- 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 temporarily 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.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..e6e78c18dac 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,52 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `toggle-mode-line-visibility' for
+;; store mode-line value in current buffer.
+(defvar-local toggle-mode-line--buf-state)
+
+(defun toggle-mode-line--hide ()
+  "Function used in command `toggle-mode-line-visibility' to hide the mode line."
+  (when mode-line-format
+    (setq toggle-mode-line--buf-state
+          (buffer-local-set-state mode-line-format nil))))
+
+(define-minor-mode toggle-mode-line-visibility
+  "Toggle mode line visibility in current buffer.
+If current buffer displays a mode line, temporarily hide it until
+command `toggle-mode-line-visibility' is called again.  Otherwise,
+display one if the buffer does not have a mode line by default.
+
+The mode line is hidden from every major mode change in current buffer."
+  :init-value nil
+  ;; Since this is a toggle command, ensure if we must display or hide
+  ;; the mode line according to `mode-line-format' value
+  (if mode-line-format
+      (progn
+        ;; Hook to prevent the mode line from being displayed again at
+        ;; each change of major mode.
+        ;; We cannot use `toggle-mode-line-visibility' in this hook
+        ;; since it will not ensure the mode line keeps hidden
+        (add-hook 'after-change-major-mode-hook #'toggle-mode-line--hide nil t)
+        (toggle-mode-line--hide))
+
+    (remove-hook 'after-change-major-mode-hook #'toggle-mode-line--hide t)
+
+    (when toggle-mode-line--buf-state
+      (setq toggle-mode-line--buf-state
+            (buffer-local-restore-state toggle-mode-line--buf-state)))
+
+    ;; Display a mode line if buffer does not have one by default
+    (unless mode-line-format
+      (setq-local mode-line-format (default-value 'mode-line-format)))
+
+    ;; Update mode line
+    (when (called-interactively-p 'any)
+      (force-mode-line-update))))
+
+(put 'toggle-mode-line--buf-state 'permanent-local t)
+(put 'toggle-mode-line--hide 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 25 Jun 2025 11:10:02 +0000
Resent-Message-ID: <handler.78881.B78881.175084974922626 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175084974922626
          (code B ref 78881); Wed, 25 Jun 2025 11:10:02 +0000
Received: (at 78881) by debbugs.gnu.org; 25 Jun 2025 11:09:09 +0000
Received: from localhost ([127.0.0.1]:60997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uUO04-0005sp-Ck
	for submit <at> debbugs.gnu.org; Wed, 25 Jun 2025 07:09:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59818)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uUO00-0005rf-Pm
 for 78881 <at> debbugs.gnu.org; Wed, 25 Jun 2025 07:09:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uUNzv-0003XF-Dv; Wed, 25 Jun 2025 07:08:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=YSJsxACOJ6WYk0D6lPvtdOJeECaInii/wSHKHotogRw=; b=TGMOB9S4NPXclJf9Cv6e
 ALAAQD5XzzbYWlt8DzHlxz2DA1RqXfvoPk33nFj6GYJhIkkgXZc9qRZ1M+lgVRDLeBvwFtf5qQhIM
 gkdSkth+Nu5HMMdZIaYIFKdZ/qnbLJeWkE8mU8Qro7ZGf+TphtEYLUPp820SgJ/PAgMGOBabJ//hN
 IZbNcgHHPy/AZvxZmX9+4oQelyZ0fdWXkdBD5wb9545ZadO+mBdoKD0uh5KlBXbWXYDGYML97M3Tv
 11XghLHm9tvqOZpW79GV2wUnSanW2TNvjcLPhnHb/9NHQOuRNftRZQmJSzi1Ii1rw4/TSgbe6qh6v
 5kK4P7/HgEMC4Q==;
Date: Wed, 25 Jun 2025 14:08:49 +0300
Message-Id: <86bjqcdqny.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <874iw5f4v0.fsf@HIDDEN> (message from Elijah Gabe
 =?UTF-8?Q?P=C3=A9rez?= on Tue, 24 Jun 2025 11:04:35 -0600)
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> 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.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 25 Jun 2025 19:01:05 +0000
Resent-Message-ID: <handler.78881.B78881.17508780525366 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.17508780525366
          (code B ref 78881); Wed, 25 Jun 2025 19:01:05 +0000
Received: (at 78881) by debbugs.gnu.org; 25 Jun 2025 19:00:52 +0000
Received: from localhost ([127.0.0.1]:39490 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uUVMV-0001LS-5A
	for submit <at> debbugs.gnu.org; Wed, 25 Jun 2025 15:00:51 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:52464)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uUVMS-000146-7V
 for 78881 <at> debbugs.gnu.org; Wed, 25 Jun 2025 15:00:45 -0400
Received: by mail-ot1-x341.google.com with SMTP id
 46e09a7af769-73a9c5ccfcdso64490a34.0
 for <78881 <at> debbugs.gnu.org>; Wed, 25 Jun 2025 12:00:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1750878038; x=1751482838; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=sfxuq8MFX7XkE9YvUXZX1TVFF/QUWlbNxd60L1qU+nM=;
 b=SBcOIBQYdyApM4r7KEWE/UDhNbVrP8R83IfqubxrBViCFKQTSzfjKX+R+TWwxBQd25
 UFLDVZPbhlOnSFuXAh7CBeOgUeOknrEOgOeB0vgglw53cpiTLHInc3oVEVGiDGFxkaGu
 Z621j4gG8fQ1/Nnz+/LYgKO1pwECN3p4gyrhYimVYDs8DjEpOxgTL4JH8jjVM1/BS3Mw
 wZtc+orvwcPCRXg+lvstgzAn+CbAgzSv5HikzcqsNceybUGYwUgHK1eNw3fCKaRFDpsW
 uhOdFBWlLYo3TwXjmeiyb3kenZO7h0/Yc87r5EBlFYmXWczd9CiuuAmj8iipOgCyiQON
 Itgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1750878038; x=1751482838;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=sfxuq8MFX7XkE9YvUXZX1TVFF/QUWlbNxd60L1qU+nM=;
 b=ZU89YSZJuKn4mC9uLV1RLPfQ/F/LdzWPz02usLpv4nkGflAAJEPlse3GU2gzPDdNgy
 vXCLu1lh8AVWjVycfC7UwoRSf6h730SbySi8IM5x6O7R1d/yaHbUWMMQzlupz4GDaAcK
 hbOlJTQmF24oSJ3gOb+Juqf51On4sOIGzl0xjHv0Y+aanwSt+CprJpYEbIXnyGcg5N2H
 OxAA8LFbjcUIMBmkHQRcHgMhr0rrGDKpb99O1F+cLK2Y8UVenx/x/LTrJfD3ah2v+xnW
 er1sKDkdUFICmkfTh8GUPgCBmk17n9pl5n5m0ocSM7ZlXwISslRR0VphllqOGFqawwkQ
 yjoQ==
X-Gm-Message-State: AOJu0YwS1Vsu8qg0F8N8N7EpfNsCg49+GyG52l5CdXk0o3a8TAISGC++
 GgrGh05xOfGbOyxKYIcPSfgqXJqu7Ci4TPSQfdaOWyk/T1CVQ4fXuheZRDCETLEY
X-Gm-Gg: ASbGncuno9joZxL8yNttGPOVhagqsCMVhgzCcpq5PBby1Fwbs28dGTrT4LcdMt69pCg
 5p5Y7OrFrLmg4tXoh2LDMb3KQY+MWoP/uS6P/cO5xYLZFrAGnf4299qBYAPRpqR2tOv1xUyUzJe
 DfUe9hHnMH0FM7hZfmPXNXh+kDSMnUnRshYYQ9D3ieh6wrYHTVVZx7bG4uPdTxA+VrtFMGm80gZ
 N7hX4g046AMhsIAq8NbsmGDE7XKfhXyeUOzTW7YW26xU06GtDJog23pwmwyxrtoNePkzYUblpys
 iArEPP/lmM2k4nejrjt6DjlV3fvdBA==
X-Google-Smtp-Source: AGHT+IFTsaZQaNZUXspmO1Yme3QX4uhEv8jQdNSahapBwQA0vDyv3QPwu3GY3fAYqFdzt1iqVTNB8A==
X-Received: by 2002:a05:6808:1924:b0:401:ea47:2c4a with SMTP id
 5614622812f47-40b057fab26mr3634682b6e.28.1750878037374; 
 Wed, 25 Jun 2025 12:00:37 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-40ac6c13318sm2289097b6e.10.2025.06.25.12.00.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 25 Jun 2025 12:00:36 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <86bjqcdqny.fsf@HIDDEN>
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
Date: Wed, 25 Jun 2025 13:00:35 -0600
Message-ID: <87y0tflk8c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> 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.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-New-command-mode-line-invisible-mode.patch

From 01f04d64e1faa5d66fe3fdaf43d4794f8c7985f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'mode-line-invisible-mode'

This new command allows hide the mode line in the current
buffer.  (Bug#78881)

* doc/emacs/display.texi (Optional Mode Line): Document feature.
* etc/NEWS: Announce changes.
* lisp/bindings.el (mode-line-invisible--buf-state): New buffer
local variable.
(mode-line-invisible-mode): New minor mode.
---
 doc/emacs/display.texi |  8 ++++++++
 etc/NEWS               |  5 +++++
 lisp/bindings.el       | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index ad496b5b1cd..c3bdf410c70 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1826,6 +1826,14 @@ Optional Mode Line
 and Emacs will hide some minor mode indicators on the mode line by
 collapsing them into a single clickable button.
 
+@findex mode-line-invisible-mode
+  By default, most buffers display a mode line, however not in many
+cases the mode line may be useful, you can use the command @kbd{M-x
+mode-line-invisible-mode} to hide the mode line in the current buffer,
+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}.
+
 @node Text Display
 @section How Text Is Displayed
 @cindex characters (in text)
diff --git a/etc/NEWS b/etc/NEWS
index f7aebdf538f..003bad3d2e0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -346,6 +346,11 @@ 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 minor mode 'mode-line-invisible-mode'.
+This command hide temporarily the mode line in current buffer until
+'mode-line-invisible-mode' is called again.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..007c096edb0 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,38 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `mode-line-invisible-mode' for
+;; store mode-line value in current buffer.
+(defvar-local mode-line-invisible--buf-state)
+
+(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."
+  :global nil
+  (if mode-line-invisible-mode
+      (progn
+        (add-hook 'after-change-major-mode-hook #'mode-line-invisible-mode nil t)
+        (setq mode-line-invisible--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (remove-hook 'after-change-major-mode-hook #'mode-line-invisible-mode t)
+
+    (when mode-line-invisible--buf-state
+      (setq mode-line-invisible--buf-state
+            (buffer-local-restore-state mode-line-invisible--buf-state)))
+
+    ;; Display a mode line if buffer does not have one by default
+    (unless mode-line-format
+      (setq-local mode-line-format (default-value 'mode-line-format)))
+
+    ;; Update mode line
+    (when (called-interactively-p 'any)
+      (force-mode-line-update))))
+
+(put 'mode-line-invisible--buf-state 'permanent-local t)
+(put 'mode-line-invisible-mode 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 28 Jun 2025 10:07:01 +0000
Resent-Message-ID: <handler.78881.B78881.175110516618394 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175110516618394
          (code B ref 78881); Sat, 28 Jun 2025 10:07:01 +0000
Received: (at 78881) by debbugs.gnu.org; 28 Jun 2025 10:06:06 +0000
Received: from localhost ([127.0.0.1]:48153 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uVSRh-0004mb-R3
	for submit <at> debbugs.gnu.org; Sat, 28 Jun 2025 06:06:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57774)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uVSRf-0004l7-6V
 for 78881 <at> debbugs.gnu.org; Sat, 28 Jun 2025 06:06:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uVSRZ-0007bs-L4; Sat, 28 Jun 2025 06:05:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=bY4s0Aa7e5MlSMarX9S1dA1W/y3gJ/NBJ0t4RKa2LpY=; b=aYH8QaOfuc3zylMe3u0W
 Bb46aZ63b1SxsY8EOFCyFzszPvcuH3adwOMyz2zB/h+wW+eDCodvhM/Mc8q4j4puzJZ2ILsyuzBDG
 sBBWJXBXS27NeBQ+xr4EzKRf9qs+1tjWM4C3vj2+JF5628seop+AUTMDawb2cDZplkb4kEy3T/L7V
 +v9eScsV0kU/JONrqHuCER2X9HS5sgmCMRzc4jcvhq78A8yrJREeUBHcyBoynVpSQUxqDvpOPIXFS
 DkQmsSCnwCJBMwiyZRcG2q9pqbY9nXR4qO1QCoXRRS9DSd1SUD1nEvrN7lPzxDEMVugW66UqwYQNu
 xaP+qKaBVe6K5A==;
Date: Sat, 28 Jun 2025 13:05:55 +0300
Message-Id: <865xgg6v0c.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87y0tflk8c.fsf@HIDDEN> (message from Elijah Gabe
 =?UTF-8?Q?P=C3=A9rez?= on Wed, 25 Jun 2025 13:00:35 -0600)
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> 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.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 28 Jun 2025 18:37:05 +0000
Resent-Message-ID: <handler.78881.B78881.175113582129482 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175113582129482
          (code B ref 78881); Sat, 28 Jun 2025 18:37:05 +0000
Received: (at 78881) by debbugs.gnu.org; 28 Jun 2025 18:37:01 +0000
Received: from localhost ([127.0.0.1]:52046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uVaQ7-0007fI-9s
	for submit <at> debbugs.gnu.org; Sat, 28 Jun 2025 14:37:00 -0400
Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:55300)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uVaQ4-0007eL-QE
 for 78881 <at> debbugs.gnu.org; Sat, 28 Jun 2025 14:36:57 -0400
Received: by mail-ot1-x341.google.com with SMTP id
 46e09a7af769-73b1b1b3cb8so45526a34.2
 for <78881 <at> debbugs.gnu.org>; Sat, 28 Jun 2025 11:36:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751135810; x=1751740610; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=siyE0jMSRRn/PCgWEyh3S1y2bxS1K6nVzdBkRI0IiLo=;
 b=cVLlvsAnj7MlVYbwCPRjKy5lQNEhFJVDh4IwsaUbDtNw9OTp16JQA9KVJ/S/uSo3xz
 39lk2G8snKl9rbznBSEwOxmSxmrMDOkU3Xo85WEMIxh2APSfO9U7+xMpzPqN+GMB1A0a
 EYqZzmXLdOktve1ntG30v0e6gTVUAZhhb/Y/zqkzodLmmFcw0CvcwNNRy8l9cPO8InZP
 wLPED3p/5UI6dH9Dm8O0Oak7+SdQWWTI/m/JTPKFGhSwd2+MPI2qEfp1PBCRROggD+1G
 PEOeLoiVQSs3osjCqezCcNg8IB8r7pMWNEPdzIkspbICy+Apwe6hRQ3nvXMP8j0q88gU
 u8xw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751135810; x=1751740610;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=siyE0jMSRRn/PCgWEyh3S1y2bxS1K6nVzdBkRI0IiLo=;
 b=PrSQr6Pupz8vb5ef37N9lLM52zZiHl2kH6RRqK1scuSRIL1xLuXf+xMU2jO+OXD+oS
 EcRAhggakY9uhB+on/4y+EuR4/FwS5qL+4yyofIrSI/eWx+u5lsv3YOfbNChsgyKTrG0
 pK4QZi2JdGycrAK3yNebioDua619QEAe06PlvWZb+zShQVwZnnRAQ0ckeXxOgKSYu1nG
 JcAbdbk+fmebLtOX5eNZ8s6Q2x0JHuxPs/mKCHHEZIPG4tC/2RYu+rdLeIisVtabtbR1
 J+X1GvPAeQwOsCYjnnjL0uqutgHBAa7OH0JuC5QVdYRFX4zGe/IpAVyIBt/gyeFyM3of
 oXFw==
X-Gm-Message-State: AOJu0Ywf9fJKRj6rFauGk2cuOHqLb4fnNDp5sv/I6Fo+uPYW6S9DqUTZ
 hEN8+rjq/kHeTimBW6znSUu/jBuZ05oiQiecQG5GIrKVtnBQa+IFync5LnOBKFf6
X-Gm-Gg: ASbGncsNmklbjyjUGhNJMmQZ8YTsnawZxiKz1C6SixQNYiwFKzPkL8EkECiIW4RvImL
 QpZ+em8OEzULELYMCexDweb4qpKmqVgnP+mzQ8rVceeCk7cWgt/Mx+9/8DozUC+3zX6tFelhF1Y
 dPOsvlWoCJ1CY5k0n3G+HbyH9dVFI2jS/d1//83J0TxQWIboXvqRlaeDAO7QdlYS+yLP3PAbBVi
 thcMuRJtQtAZY0wl8F4lXtc5oYjYVLsoRf2V6SfbJ4D1p5DIXYjbiC/VVHVpuaXaiv9CucOIoY5
 b/WgBAm0O/YAdALxtYgtr2vyLbONLg==
X-Google-Smtp-Source: AGHT+IFo/ZsvdQeNjVbvwun4UwAlcQZn6nSPh8KpIBEe5ZWjoG+UoW/v2poQR5I/lgMiBjKYPWwpOQ==
X-Received: by 2002:a05:6808:1796:b0:408:fbb6:f4cb with SMTP id
 5614622812f47-40b33c2a043mr6505256b6e.6.1751135810324; 
 Sat, 28 Jun 2025 11:36:50 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-40b32289870sm922706b6e.8.2025.06.28.11.36.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 28 Jun 2025 11:36:49 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <865xgg6v0c.fsf@HIDDEN>
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
Date: Sat, 28 Jun 2025 12:36:47 -0600
Message-ID: <87wm8v4ssg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> 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:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-New-command-mode-line-invisible-mode.patch

From ac44abc17b9211feac4f3b99f9fb7fb6cd273fbe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'mode-line-invisible-mode'

This new command allows hide the mode line in the current
buffer.  (Bug#78881)

* doc/emacs/display.texi (Optional Mode Line): Document feature.
* etc/NEWS: Announce changes.
* lisp/bindings.el (mode-line-invisible--buf-state): New buffer
local variable.
(mode-line-invisible-mode): New minor mode.
---
 doc/emacs/display.texi |  8 ++++++++
 etc/NEWS               |  5 +++++
 lisp/bindings.el       | 31 +++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index ad496b5b1cd..fca9aebe927 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1826,6 +1826,14 @@ Optional Mode Line
 and Emacs will hide some minor mode indicators on the mode line by
 collapsing them into a single clickable button.
 
+@findex mode-line-invisible-mode
+  By default, most buffers display a mode line, but if the mode line is
+not useful in a buffer, you can use the command @w{@kbd{M-x
+mode-line-invisible-mode}} to hide the mode line in the current buffer,
+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 @pxref{Hooks}.
+
 @node Text Display
 @section How Text Is Displayed
 @cindex characters (in text)
diff --git a/etc/NEWS b/etc/NEWS
index eb85baae341..32e5d2d2f01 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -353,6 +353,11 @@ 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 minor mode 'mode-line-invisible-mode'.
+This command toggles the mode-line visibility of the current buffer:
+hides it if it is shown, and shows it if it's hidden.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..d7ec11ca323 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,37 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `mode-line-invisible-mode' for
+;; store mode-line value in current buffer.
+(defvar-local mode-line-invisible--buf-state)
+
+(define-minor-mode mode-line-invisible-mode
+  "Toggle the mode-line visibility of the current buffer.
+Hide the mode line if it is shown, and show it if it's hidden."
+  :global nil
+  (if mode-line-invisible-mode
+      (progn
+        (add-hook 'after-change-major-mode-hook #'mode-line-invisible-mode nil t)
+        (setq mode-line-invisible--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (remove-hook 'after-change-major-mode-hook #'mode-line-invisible-mode t)
+
+    (when mode-line-invisible--buf-state
+      (setq mode-line-invisible--buf-state
+            (buffer-local-restore-state mode-line-invisible--buf-state)))
+
+    ;; Display a mode line if buffer does not have one by default
+    (unless mode-line-format
+      (setq-local mode-line-format (default-value 'mode-line-format)))
+
+    ;; Update mode line
+    (when (called-interactively-p 'any)
+      (force-mode-line-update))))
+
+(put 'mode-line-invisible--buf-state 'permanent-local t)
+(put 'mode-line-invisible-mode 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.50.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Eli Zaretskii <eliz@HIDDEN>
Subject: bug#78881: closed ([PATCH] New command 'toggle-mode-line-visibility')
CC: tracker <at> debbugs.gnu.org
Message-ID: <handler.78881.D78881.175170468012463.ackdone <at> debbugs.gnu.org>
References: <86frfbvxr7.fsf@HIDDEN> <8734bqz2lv.fsf@HIDDEN>
X-Gnu-PR-Message: closed 78881
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Date: Sat, 05 Jul 2025 08:38:01 +0000
Content-Type: multipart/mixed; boundary="----------=_1751704681-12482-0"

This is a multi-part message in MIME format...

------------=_1751704681-12482-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

Your message dated Sat, 05 Jul 2025 11:37:48 +0300
with message-id <86frfbvxr7.fsf@HIDDEN>
and subject line Re: bug#78881: [PATCH] New command 'toggle-mode-line-visib=
ility'
has caused the debbugs.gnu.org bug report #78881,
regarding [PATCH] New command 'toggle-mode-line-visibility'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@HIDDEN)


--=20
78881: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78881
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1751704681-12482-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 23 Jun 2025 19:21:07 +0000
Received: from localhost ([127.0.0.1]:57888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTmj4-0007kX-0c
	for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:07 -0400
Received: from lists.gnu.org ([2001:470:142::17]:59504)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uTmiz-0007hw-4E
 for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmio-0007E2-NH
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:52 -0400
Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmim-0006cU-KA
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:50 -0400
Received: by mail-oi1-x241.google.com with SMTP id
 5614622812f47-40af40aee93so101833b6e.0
 for <bug-gnu-emacs@HIDDEN>; Mon, 23 Jun 2025 12:20:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1750706446; x=1751311246; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=UvoseClBOsUsnHFb7VLHXlbCUp/peRSHBRPClt9E5Kk4k37PhUYyLbguXJZabbPyJB
 UA0jD4vY2OU1kbRBNQMjdN011AMeBda9sIC7vn/BLkadidvsORC6qvS6i5vJJqub2s0w
 BxggQBxby8aJdPts6C8F+EetO7qVV5E53/7QhXHctGavwVXt6VNPki83eMeih4OH6NNW
 6tXlBGlD6l/eRMcbFdZpwZJ39CuYRXqM66UDoanawsbC5frrUtr1DPNJ/vbNw2rl39Yr
 vbHRbOD5+AAQOS/AYW7bDdlaCNH6MzAtIkHt+6qyACLPFX347GSpfClC84hx9Y/XV5v/
 kvHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1750706446; x=1751311246;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=NcHUherBHOYmEUoBmgzHSMkEX22HlnzFjC4poclJUZjYY5bgjc2fLEKPT6fcH9WlpV
 FrfoTBpdif2XHLe8rlKi6eopG6SNwsHEcZ2vTPZYfnIY88BOWf232aI0waSXOSEZlWus
 WU3HVIzJtecxsVOENx9JGdiZmlfrhC3G35JAFUfPhXzfLM8IhEVaoKtV9oNZYNf1w5ks
 T8FiQVApN+uZgarwiZAnnR2KrgPMgx+lP0TD/nxnVIFnvUzH5gwyqgqKcUalVFtY9n/G
 S4Erb74GYuLMWJcs6nMenKK8IUsQZ0kwUiesyXYF9P2cD/c0su7sS6+amulHke7CU8Ep
 61xA==
X-Gm-Message-State: AOJu0YyvXA0ZXoq60xjZJBRAacO1Q+pUd3g/WPWklE36j+xA2k3qgHmX
 NVcCfyOAvgxhViZSBwWH1c1Ny92be2ZuzbQA1q1SY3S5lvP0IPtx8P9oD/C6T+o1
X-Gm-Gg: ASbGncvsfq/QtzV96zELCO4tElfrcRsbXZ/xMhDH9IVFopvmKr4Px/30G9jxSNOo6uG
 5ndTLq/OoxzdAAA1/L1EZWoslnioiix/xiYcD7yWeferp+xnX2wC9WRbUABxJUflQoWKJ9FcOJF
 3EGBQlESUjqIe5pib+WDcF7llAro0WP6RyxI/EQ3G//22TdusM9XR3FWdBzr4XmvpZPHtRh0VLN
 bPFWklbAAaBGlstYwstGgXFIYChLu9ZUGX8cjDFLth2mK3ze49rUsO65K/XE1OhknfaH4dxmuVS
 b0vdkecTKtawfIl7hgzeYiRyK2xSbQ==
X-Google-Smtp-Source: AGHT+IFXZ6TF1NRB+AZi452cVb6heDGKSCO2ZPW/QMXVsSQxdKBpD3JZ+V7yAkAPITpvHiiV7izRHQ==
X-Received: by 2002:a05:6808:220b:b0:402:862:93ae with SMTP id
 5614622812f47-40ac6f526ebmr10524796b6e.16.1750706446313; 
 Mon, 23 Jun 2025 12:20:46 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-40ac6d11bacsm1516980b6e.35.2025.06.23.12.20.45
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 23 Jun 2025 12:20:45 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] New command 'toggle-mode-line-visibility'
X-Debbugs-Cc: 
Date: Mon, 23 Jun 2025 13:20:44 -0600
Message-ID: <8734bqz2lv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::241;
 envelope-from=eg642616@HIDDEN; helo=mail-oi1-x241.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: 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. 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

--=-=-=
Content-Type: text/plain

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 :^).


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-New-command-toggle-mode-line-visibility.patch

From a3c36ce32da275a6213e28a8feb3abe1b27ba87a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'toggle-mode-line-visibility'

This new command allows toggle the mode line visibility in the
current buffer.  (Bug#)

* etc/NEWS: Announce changes.
* lisp/bindings.el (toggle-mode-line--buf-state): New buffer
local variable.
(toggle-mode-line-visibility): New command.
(disable-mode-line): New function.
---
 etc/NEWS         |  8 ++++++++
 lisp/bindings.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 6f3d28d0e03..c9de3feae63 100644
--- 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.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..6c7d47dcd4a 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,52 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `toggle-mode-line-visibility' for
+;; store mode-line value in current buffer.
+(defvar-local toggle-mode-line--buf-state)
+
+(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
+`toggle-mode-line-visibility' is called again.  Otherwise, display one
+if the buffer does not have a mode line by default.
+
+The mode line is hidden from every major mode change in current buffer.
+
+If HIDE-ONLY is non-nil, only hide the mode-line."
+  (interactive "^P")
+  (if mode-line-format
+      (progn
+        ;; Hook to prevent the mode line from being displayed again at
+        ;; each change of major mode.
+        (add-hook 'after-change-major-mode-hook #'disable-mode-line nil t)
+        (setq toggle-mode-line--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (unless hide-only
+      (remove-hook 'after-change-major-mode-hook #'disable-mode-line t)
+      (setq toggle-mode-line--buf-state
+            (buffer-local-restore-state toggle-mode-line--buf-state))
+
+      ;; Display a mode line if buffer does not have one by default.
+      (unless mode-line-format
+        (setq-local mode-line-format (default-value 'mode-line-format)))
+
+      ;; Update mode line.
+      (when (called-interactively-p 'any)
+        (force-mode-line-update)))))
+
+;; NOTE: This function is intended to be used in hooks.
+(defun disable-mode-line ()
+  "Hide the mode-line in current buffer.
+The mode line is hidden from every major mode change in current buffer.
+
+See `toggle-mode-line-visibility'."
+  (toggle-mode-line-visibility 'hide))
+
+(put 'toggle-mode-line--buf-state 'permanent-local t)
+(put 'disable-mode-line 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--



------------=_1751704681-12482-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 78881-done) by debbugs.gnu.org; 5 Jul 2025 08:38:00 +0000
Received: from localhost ([127.0.0.1]:39884 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uXyPH-0003Et-KQ
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:37:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51222)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uXyPE-0003Dc-Lw
 for 78881-done <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:37:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uXyP9-00017N-8C; Sat, 05 Jul 2025 04:37:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=byCDbvzEsFl4OusBbA9L/XAIByK9hZs8wL27UqFJQYo=; b=iR3k1DIPM799/oo7lecU
 4DE6BbSyWzq55lxsnNIYchDCeBWj0b/SkgKiOZHH6o4OOIblivRcAwu+DLdFS9nMc7CGYx+rGsqf+
 VKhfRjeHPBQTiK5uDJPuFc/muA3yfHh/M0SF+Ka1QEVe0RaNgAqG8pKByFDtXoz+s5wDyWzJNARQM
 Ahnfnijf6CGRgPapAs3AmzREiMaAkNU3dJvvlbPYFimBHAcTJersDctHSTpwkA0gKlD7Tu3f3df+z
 iF8MIQbKG4hIIOs7un5Ymj+sXgD+am+v1XGSVZOZv9JO+nx8WDwgAJ/+QBKibFY+9WlW6OZeEvXJY
 LKcazbC7Hoz8bw==;
Date: Sat, 05 Jul 2025 11:37:48 +0300
Message-Id: <86frfbvxr7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <87wm8v4ssg.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Sat, 28 Jun 2025 12:36:47 -0600)
Subject: Re: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
 <87wm8v4ssg.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78881-done
Cc: 78881-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: 78881 <at> debbugs.gnu.org
> Date: Sat, 28 Jun 2025 12:36:47 -0600
> 
> Eli Zaretskii <eliz@HIDDEN> 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.


------------=_1751704681-12482-0--


Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: bug#78881: closed (Re: bug#78881: [PATCH] New command
 'toggle-mode-line-visibility')
Message-ID: <handler.78881.D78881.175170468012463.notifdone <at> debbugs.gnu.org>
References: <86frfbvxr7.fsf@HIDDEN> <8734bqz2lv.fsf@HIDDEN>
X-Gnu-PR-Message: they-closed 78881
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 78881 <at> debbugs.gnu.org
Date: Sat, 05 Jul 2025 08:38:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1751704682-12482-1"

This is a multi-part message in MIME format...

------------=_1751704682-12482-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 78881 <at> debbugs.gnu.org.

--=20
78881: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D78881
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1751704682-12482-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 78881-done) by debbugs.gnu.org; 5 Jul 2025 08:38:00 +0000
Received: from localhost ([127.0.0.1]:39884 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uXyPH-0003Et-KQ
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:37:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51222)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uXyPE-0003Dc-Lw
 for 78881-done <at> debbugs.gnu.org; Sat, 05 Jul 2025 04:37:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uXyP9-00017N-8C; Sat, 05 Jul 2025 04:37:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=byCDbvzEsFl4OusBbA9L/XAIByK9hZs8wL27UqFJQYo=; b=iR3k1DIPM799/oo7lecU
 4DE6BbSyWzq55lxsnNIYchDCeBWj0b/SkgKiOZHH6o4OOIblivRcAwu+DLdFS9nMc7CGYx+rGsqf+
 VKhfRjeHPBQTiK5uDJPuFc/muA3yfHh/M0SF+Ka1QEVe0RaNgAqG8pKByFDtXoz+s5wDyWzJNARQM
 Ahnfnijf6CGRgPapAs3AmzREiMaAkNU3dJvvlbPYFimBHAcTJersDctHSTpwkA0gKlD7Tu3f3df+z
 iF8MIQbKG4hIIOs7un5Ymj+sXgD+am+v1XGSVZOZv9JO+nx8WDwgAJ/+QBKibFY+9WlW6OZeEvXJY
 LKcazbC7Hoz8bw==;
Date: Sat, 05 Jul 2025 11:37:48 +0300
Message-Id: <86frfbvxr7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <87wm8v4ssg.fsf@HIDDEN> (message from Elijah Gabe
 =?utf-8?Q?P=C3=A9rez?= on Sat, 28 Jun 2025 12:36:47 -0600)
Subject: Re: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
 <87wm8v4ssg.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78881-done
Cc: 78881-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Elijah Gabe Pérez <eg642616@HIDDEN>
> Cc: 78881 <at> debbugs.gnu.org
> Date: Sat, 28 Jun 2025 12:36:47 -0600
> 
> Eli Zaretskii <eliz@HIDDEN> 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.


------------=_1751704682-12482-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 23 Jun 2025 19:21:07 +0000
Received: from localhost ([127.0.0.1]:57888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uTmj4-0007kX-0c
	for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:07 -0400
Received: from lists.gnu.org ([2001:470:142::17]:59504)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uTmiz-0007hw-4E
 for submit <at> debbugs.gnu.org; Mon, 23 Jun 2025 15:21:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmio-0007E2-NH
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:52 -0400
Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1uTmim-0006cU-KA
 for bug-gnu-emacs@HIDDEN; Mon, 23 Jun 2025 15:20:50 -0400
Received: by mail-oi1-x241.google.com with SMTP id
 5614622812f47-40af40aee93so101833b6e.0
 for <bug-gnu-emacs@HIDDEN>; Mon, 23 Jun 2025 12:20:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1750706446; x=1751311246; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=UvoseClBOsUsnHFb7VLHXlbCUp/peRSHBRPClt9E5Kk4k37PhUYyLbguXJZabbPyJB
 UA0jD4vY2OU1kbRBNQMjdN011AMeBda9sIC7vn/BLkadidvsORC6qvS6i5vJJqub2s0w
 BxggQBxby8aJdPts6C8F+EetO7qVV5E53/7QhXHctGavwVXt6VNPki83eMeih4OH6NNW
 6tXlBGlD6l/eRMcbFdZpwZJ39CuYRXqM66UDoanawsbC5frrUtr1DPNJ/vbNw2rl39Yr
 vbHRbOD5+AAQOS/AYW7bDdlaCNH6MzAtIkHt+6qyACLPFX347GSpfClC84hx9Y/XV5v/
 kvHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1750706446; x=1751311246;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=g2eVY16lgv0pChcbeBk80g4287qOvAKY1mPLPXUEPMk=;
 b=NcHUherBHOYmEUoBmgzHSMkEX22HlnzFjC4poclJUZjYY5bgjc2fLEKPT6fcH9WlpV
 FrfoTBpdif2XHLe8rlKi6eopG6SNwsHEcZ2vTPZYfnIY88BOWf232aI0waSXOSEZlWus
 WU3HVIzJtecxsVOENx9JGdiZmlfrhC3G35JAFUfPhXzfLM8IhEVaoKtV9oNZYNf1w5ks
 T8FiQVApN+uZgarwiZAnnR2KrgPMgx+lP0TD/nxnVIFnvUzH5gwyqgqKcUalVFtY9n/G
 S4Erb74GYuLMWJcs6nMenKK8IUsQZ0kwUiesyXYF9P2cD/c0su7sS6+amulHke7CU8Ep
 61xA==
X-Gm-Message-State: AOJu0YyvXA0ZXoq60xjZJBRAacO1Q+pUd3g/WPWklE36j+xA2k3qgHmX
 NVcCfyOAvgxhViZSBwWH1c1Ny92be2ZuzbQA1q1SY3S5lvP0IPtx8P9oD/C6T+o1
X-Gm-Gg: ASbGncvsfq/QtzV96zELCO4tElfrcRsbXZ/xMhDH9IVFopvmKr4Px/30G9jxSNOo6uG
 5ndTLq/OoxzdAAA1/L1EZWoslnioiix/xiYcD7yWeferp+xnX2wC9WRbUABxJUflQoWKJ9FcOJF
 3EGBQlESUjqIe5pib+WDcF7llAro0WP6RyxI/EQ3G//22TdusM9XR3FWdBzr4XmvpZPHtRh0VLN
 bPFWklbAAaBGlstYwstGgXFIYChLu9ZUGX8cjDFLth2mK3ze49rUsO65K/XE1OhknfaH4dxmuVS
 b0vdkecTKtawfIl7hgzeYiRyK2xSbQ==
X-Google-Smtp-Source: AGHT+IFXZ6TF1NRB+AZi452cVb6heDGKSCO2ZPW/QMXVsSQxdKBpD3JZ+V7yAkAPITpvHiiV7izRHQ==
X-Received: by 2002:a05:6808:220b:b0:402:862:93ae with SMTP id
 5614622812f47-40ac6f526ebmr10524796b6e.16.1750706446313; 
 Mon, 23 Jun 2025 12:20:46 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 5614622812f47-40ac6d11bacsm1516980b6e.35.2025.06.23.12.20.45
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 23 Jun 2025 12:20:45 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] New command 'toggle-mode-line-visibility'
X-Debbugs-Cc: 
Date: Mon, 23 Jun 2025 13:20:44 -0600
Message-ID: <8734bqz2lv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::241;
 envelope-from=eg642616@HIDDEN; helo=mail-oi1-x241.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: 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. 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

--=-=-=
Content-Type: text/plain

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 :^).


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-New-command-toggle-mode-line-visibility.patch

From a3c36ce32da275a6213e28a8feb3abe1b27ba87a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'toggle-mode-line-visibility'

This new command allows toggle the mode line visibility in the
current buffer.  (Bug#)

* etc/NEWS: Announce changes.
* lisp/bindings.el (toggle-mode-line--buf-state): New buffer
local variable.
(toggle-mode-line-visibility): New command.
(disable-mode-line): New function.
---
 etc/NEWS         |  8 ++++++++
 lisp/bindings.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 6f3d28d0e03..c9de3feae63 100644
--- 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.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 8b021a05ce2..6c7d47dcd4a 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -56,6 +56,52 @@ mode-line-widen
     (widen)
     (force-mode-line-update)))
 
+;; Variable used by `toggle-mode-line-visibility' for
+;; store mode-line value in current buffer.
+(defvar-local toggle-mode-line--buf-state)
+
+(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
+`toggle-mode-line-visibility' is called again.  Otherwise, display one
+if the buffer does not have a mode line by default.
+
+The mode line is hidden from every major mode change in current buffer.
+
+If HIDE-ONLY is non-nil, only hide the mode-line."
+  (interactive "^P")
+  (if mode-line-format
+      (progn
+        ;; Hook to prevent the mode line from being displayed again at
+        ;; each change of major mode.
+        (add-hook 'after-change-major-mode-hook #'disable-mode-line nil t)
+        (setq toggle-mode-line--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (unless hide-only
+      (remove-hook 'after-change-major-mode-hook #'disable-mode-line t)
+      (setq toggle-mode-line--buf-state
+            (buffer-local-restore-state toggle-mode-line--buf-state))
+
+      ;; Display a mode line if buffer does not have one by default.
+      (unless mode-line-format
+        (setq-local mode-line-format (default-value 'mode-line-format)))
+
+      ;; Update mode line.
+      (when (called-interactively-p 'any)
+        (force-mode-line-update)))))
+
+;; NOTE: This function is intended to be used in hooks.
+(defun disable-mode-line ()
+  "Hide the mode-line in current buffer.
+The mode line is hidden from every major mode change in current buffer.
+
+See `toggle-mode-line-visibility'."
+  (toggle-mode-line-visibility 'hide))
+
+(put 'toggle-mode-line--buf-state 'permanent-local t)
+(put 'disable-mode-line 'permanent-local-hook t)
+
 (defvar mode-line-input-method-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mode-line mouse-2]
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--



------------=_1751704682-12482-1--


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 05 Jul 2025 10:36:02 +0000
Resent-Message-ID: <handler.78881.B78881.175171175517530 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>, eg642616@HIDDEN
Cc: 78881 <at> debbugs.gnu.org
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175171175517530
          (code B ref 78881); Sat, 05 Jul 2025 10:36:02 +0000
Received: (at 78881) by debbugs.gnu.org; 5 Jul 2025 10:35:55 +0000
Received: from localhost ([127.0.0.1]:41281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uY0FP-0004Ye-3V
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 06:35:55 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55984)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uY0FM-0004Xa-6I
 for 78881 <at> debbugs.gnu.org; Sat, 05 Jul 2025 06:35:52 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1uY0FG-0004Ex-J0; Sat, 05 Jul 2025 06:35:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=XZwGHvDZH05wpv9LyVsEpv6KiFvh5H2bYfKkaLPipNw=; b=WfVFtLKIrWB8hMX2EnKz
 6V0peEkkYNvKqVoq7OzAuo+hQM7w1BNPXVRO19CBs7KwnVEgKCDzqHtc2UAVaLWoOZ5dYVrq2Y3+U
 qgwDw36h5hN2ki0lMU2alr6SYFnBPLBAvOENrmfgauU+lHwrxKLViPmK2YxAd7pJGgjFjQ55jWoNQ
 YRAIpjHxFw59NNiUU9ggZxyGMjuLUKpuBV/IlMzUhAozm+FGLu8Ev/iBavkcr4z1YQUCi+g8RsAkU
 5DevLXBs9O3TgGu00Fpc5tUUofgCbHSkIBc/1oOAJpDpFcGxfOV1wwEO9HqgBBxd5IeF6WVYWJdUJ
 f/n9TaeYlnlGwg==;
Date: Sat, 05 Jul 2025 13:35:21 +0300
Message-Id: <861pqvvsba.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <86frfbvxr7.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 05
 Jul 2025 11:37:48 +0300)
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
 <87wm8v4ssg.fsf@HIDDEN> <86frfbvxr7.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Resent-To: bug-gnu-emacs@HIDDEN
> Cc: 78881-done <at> debbugs.gnu.org
> Date: Sat, 05 Jul 2025 11:37:48 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Elijah Gabe Pérez <eg642616@HIDDEN>
> > Cc: 78881 <at> debbugs.gnu.org
> > Date: Sat, 28 Jun 2025 12:36:47 -0600
> > 
> > Eli Zaretskii <eliz@HIDDEN> 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.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 05 Jul 2025 14:58:02 +0000
Resent-Message-ID: <handler.78881.B78881.175172742317879 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org, eg642616@HIDDEN
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175172742317879
          (code B ref 78881); Sat, 05 Jul 2025 14:58:02 +0000
Received: (at 78881) by debbugs.gnu.org; 5 Jul 2025 14:57:03 +0000
Received: from localhost ([127.0.0.1]:45965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uY4K5-0004e5-Cf
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 10:57:02 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58979)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1uY4K3-0004cz-1w
 for 78881 <at> debbugs.gnu.org; Sat, 05 Jul 2025 10:56:59 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 625D4441470;
 Sat,  5 Jul 2025 10:56:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1751727408;
 bh=t3CmnbMepVzPBjscol7H0l5tX07qbqLx+cwXOk9jwkE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=C7s+oyUiQwitYKY6SyBJHGBROwA1D4ZL7FdyHO9N1kIqA4QOFGm/YSfF6APvFLk7n
 0JJiRCO234zOMnt+pAl5Y8/t0I3ZVRLiDddqOVksTb2IU2oDTbasLKBh3Dt3jCiiJx
 aq73sqdSaops9SmJnn4i2/mbdncREHRo1r/OS0BFYZElpTwzR3CkKzo2tw1zOw1PEZ
 6pHHb4YoaALf22FAr5loJJSrdw6CS2O+SlaZLyM3tEaxC+8eLL2N+JkHK9j95hWxRo
 +3rtpcAG6tyHPi0bxM6UDiPphQE9Aor4N77TJGdvW/6CDEUOjzTvPfoNCYiDt7AIDS
 IhnbKdSFiCgbw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 487E3440F89;
 Sat,  5 Jul 2025 10:56:48 -0400 (EDT)
Received: from alfajor (unknown [104.247.225.139])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0AFDB120919;
 Sat,  5 Jul 2025 10:56:48 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <861pqvvsba.fsf@HIDDEN>
Message-ID: <jwv1pqu1ybk.fsf-monnier+emacs@HIDDEN>
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
 <87wm8v4ssg.fsf@HIDDEN> <86frfbvxr7.fsf@HIDDEN>
 <861pqvvsba.fsf@HIDDEN>
Date: Sat, 05 Jul 2025 10:56:47 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.281 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.1 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.1 (---)

> 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





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#78881: [PATCH] New command 'toggle-mode-line-visibility'
Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 05 Jul 2025 20:46:02 +0000
Resent-Message-ID: <handler.78881.B78881.175174832518110 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 78881
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 78881 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 78881-submit <at> debbugs.gnu.org id=B78881.175174832518110
          (code B ref 78881); Sat, 05 Jul 2025 20:46:02 +0000
Received: (at 78881) by debbugs.gnu.org; 5 Jul 2025 20:45:25 +0000
Received: from localhost ([127.0.0.1]:47745 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uY9lD-0004gL-Qx
	for submit <at> debbugs.gnu.org; Sat, 05 Jul 2025 16:45:24 -0400
Received: from mail-oo1-xc44.google.com ([2607:f8b0:4864:20::c44]:44296)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1uY9lB-0004TE-5V
 for 78881 <at> debbugs.gnu.org; Sat, 05 Jul 2025 16:45:22 -0400
Received: by mail-oo1-xc44.google.com with SMTP id
 006d021491bc7-60402c94319so1181336eaf.1
 for <78881 <at> debbugs.gnu.org>; Sat, 05 Jul 2025 13:45:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1751748315; x=1752353115; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=LY8mLswPB6OYnHHLakyz2FQ++V1MIYCoS6WHpjMhZQc=;
 b=VrqyuNWAT7yzty9lGhjAOvVJhvXPVHSSNLp3xQq10gZ/vRU6saVbGOH7wlhuZ6eRXJ
 APQsptPC+WpUBFHdcBKS7wXLUmVhe3d/6d4XrWItRREuqFuyF0y2Dn/T/H7jmYNT9mWL
 4RG4xzxq2BJS3YcNdvbBBYNoHi0tV83onkSR5HMr8b+ITewhOeofv+xtFrMZiiyoH15/
 GCpiJN3RfVm4sv5Wqc0Dnx9tfBLtSATIfHXx77erVrV+Fsz1sEED2jn1gmC57NyWwHSH
 Y7+rduAWx2juovWijjv3pfJWZGSMdt4bvCpfAC6M4b18ZeDdL22PqpD/3PDxJ5Dsq3N7
 pFBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1751748315; x=1752353115;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=LY8mLswPB6OYnHHLakyz2FQ++V1MIYCoS6WHpjMhZQc=;
 b=gjmiyISiuvxueLxuZttn06ZONqOKZ3hQtceDMHiyQ/R31iqjvmhfTr4O9jMJGBStea
 5Re70GWsVUZGPSiZzzcRvTLAXZelsjiw+ABHAYVOOSfJKAYxTqxyfwjFNIgwKJ2YBxmL
 VnE75eFnxe1KcvhpjpITeKWk0OaBD/2oDwRSRueEqM7PXZZcH6QAMXqddZnSZm9H7eNV
 MkJF5VQfCA50gyz38muveIE1Bth6gNB6aS+hJOh8XRXBq0ra9EV2E461+tiaCQxaMess
 OwGdQQOF4d06egz+g98GL3stGDadOCTSXhsknyBsFwR0WXvbdpJvTckQqvYHq28BPtS+
 LqEQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVkK276OXV4OoRX0xSuO08hFl8Z9iLAjz5GzTLbrn2aGJAMJn+3zVt/ITJ1tKiyvkTDLPectg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxdoZWAREC+pDdRSIoHUud6yB3oxuQlXUK6J8RvMDB8EGH4cdv5
 bCFDz2Eyq+wDe4OMD7gtvtBYhA1oivsvjKdgF9OutnCzlL586MDVeIBAhMcdT15C
X-Gm-Gg: ASbGncuiNEABMZ70SBB0jc26LCovMhoJSFs+OAYWPxvW8WjO6RdXzf4xOppXsdVpjjQ
 MgzU8ELoIq1/COtJJX66gWeoQv39V2piWrzOPH++C5qdQqnkWayf+v4OM8p0+/hW56AqdWIxZCb
 IEW/84OwmXyMOy815jCkNMSOr0GdnaialwsYOcJOz12Rw0IHZWcQzQfDlOgl5TFhrYnLkvY24Gl
 zoZyxC7virXL8Vtv4KK9GCLq2qZoAQMysZhJeB6dMaiO/F+CPg/q4rkH8NslE0pdUHHs006PpwG
 APmuGzQMSxQl9kQ9tnxvVRgo28Wi+w==
X-Google-Smtp-Source: AGHT+IGasbl+nuNUii9dJgEkTedXN6Q3ZUGV3fcB9OLY1h+2FwUHWzx7gEoFuPHYWAa+ikOXlAf3BA==
X-Received: by 2002:a05:6820:179b:b0:611:aabf:2b7d with SMTP id
 006d021491bc7-613a007fd4bmr2525044eaf.7.1751748314921; 
 Sat, 05 Jul 2025 13:45:14 -0700 (PDT)
Received: from fedora ([2806:10ae:e:b56a::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-6138e5c1db3sm748819eaf.35.2025.07.05.13.45.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 05 Jul 2025 13:45:14 -0700 (PDT)
From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
In-Reply-To: <861pqvvsba.fsf@HIDDEN>
References: <8734bqz2lv.fsf@HIDDEN> <86zfdxe6bw.fsf@HIDDEN>
 <874iw5f4v0.fsf@HIDDEN> <86bjqcdqny.fsf@HIDDEN>
 <87y0tflk8c.fsf@HIDDEN> <865xgg6v0c.fsf@HIDDEN>
 <87wm8v4ssg.fsf@HIDDEN> <86frfbvxr7.fsf@HIDDEN>
 <861pqvvsba.fsf@HIDDEN>
Date: Sat, 05 Jul 2025 14:45:12 -0600
Message-ID: <87frfa1i5j.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> 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:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-New-command-mode-line-invisible-mode.patch

From 20a7ae98dd5f4e7fd83f4c0dfc6f5dddaeee8913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Mon, 23 Jun 2025 12:50:28 -0600
Subject: [PATCH] New command 'mode-line-invisible-mode'

This new command allows hide the mode line in the current
buffer.  (Bug#78881)

* doc/emacs/display.texi (Optional Mode Line): Document feature.
* etc/NEWS: Announce changes.
* lisp/simple.el (mode-line-invisible--buf-state): New buffer
local variable.
(mode-line-invisible-mode): New minor mode.
---
 doc/emacs/display.texi |  8 ++++++++
 etc/NEWS               |  7 +++++++
 lisp/simple.el         | 31 +++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index ad496b5b1cd..8da0495f531 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1826,6 +1826,14 @@ Optional Mode Line
 and Emacs will hide some minor mode indicators on the mode line by
 collapsing them into a single clickable button.
 
+@findex mode-line-invisible-mode
+  By default, most buffers display a mode line, but if the mode line is
+not useful in a buffer, you can use the command @w{@kbd{M-x
+mode-line-invisible-mode}} to hide the mode line in the current buffer,
+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 (@pxref{Hooks}).
+
 @node Text Display
 @section How Text Is Displayed
 @cindex characters (in text)
diff --git a/etc/NEWS b/etc/NEWS
index 3703f5b3dbf..2e3e6d09791 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -353,6 +353,13 @@ 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 minor mode 'mode-line-invisible-mode'.
+This minor mode makes the mode-line of the current buffer invisible.
+The command 'mode-line-invisible-mode' toggles the visibility of the
+current-buffer's mode-line.  The default is to show the mode line of
+every buffer.
+
 ** Tab Bars and Tab Lines
 
 ---
diff --git a/lisp/simple.el b/lisp/simple.el
index fa173b26289..f2a66bbfba2 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9382,6 +9382,37 @@ size-indication-mode
   "Toggle buffer size display in the mode line (Size Indication mode)."
   :global t :group 'mode-line)
 
+(defvar-local mode-line-invisible--buf-state)
+
+(define-minor-mode mode-line-invisible-mode
+  "Toggle the mode-line visibility of the current buffer.
+Hide the mode line if it is shown, and show it if it's hidden."
+  :global nil
+  :group 'mode-line
+  (if mode-line-invisible-mode
+      (progn
+        (add-hook 'after-change-major-mode-hook #'mode-line-invisible-mode nil t)
+        (setq mode-line-invisible--buf-state
+              (buffer-local-set-state mode-line-format nil)))
+
+    (remove-hook 'after-change-major-mode-hook #'mode-line-invisible-mode t)
+
+    ;; Restore buffer mode line if buffer had one by default
+    (when mode-line-invisible--buf-state
+      (setq mode-line-invisible--buf-state
+            (buffer-local-restore-state mode-line-invisible--buf-state)))
+
+    ;; Otherwise display one
+    (unless mode-line-format
+      (setq-local mode-line-format (default-value 'mode-line-format)))
+
+    ;; Update mode line
+    (when (called-interactively-p 'any)
+      (force-mode-line-update))))
+
+(put 'mode-line-invisible--buf-state 'permanent-local t)
+(put 'mode-line-invisible-mode 'permanent-local-hook t)
+
 (defcustom remote-file-name-inhibit-auto-save nil
   "When nil, `auto-save-mode' will auto-save remote files.
 Any other value means that it will not."
-- 
2.50.0


--=-=-=
Content-Type: text/plain


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

--=-=-=--





Last modified: Sat, 5 Jul 2025 20:45:05 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.