[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e72fd12: * lisp/tab-bar.el (toggle-frame-tab-bar): New command (b

From: Juri Linkov
Subject: master e72fd12: * lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556)
Date: Tue, 5 Jan 2021 13:43:38 -0500 (EST)

branch: master
commit e72fd12ec688efe046de98d5a6494fe2ffab7762
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556)
 lisp/tab-bar.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 93f3c55..b44fcfa 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -196,6 +196,18 @@ See `tab-bar-mode' for more information."
       (tab-bar-mode (if (> (frame-parameter nil 'tab-bar-lines) 0) 0 1))
     (tab-bar-mode arg)))
+(defun toggle-frame-tab-bar (&optional frame)
+  "Toggle tab bar of FRAME.
+This is useful when you want to enable the tab bar individually
+on each new frame when the global `tab-bar-mode' is disabled,
+or when you want to disable the tab bar individually on each
+new frame when the global `tab-bar-mode' is enabled, by using
+  (add-hook 'after-make-frame-functions 'toggle-frame-tab-bar)"
+  (interactive)
+  (set-frame-parameter frame 'tab-bar-lines
+                       (if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1)))
 (defvar tab-bar-map (make-sparse-keymap)
   "Keymap for the tab bar.
 Define this locally to override the global tab bar.")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]