diff options
| author | Juri Linkov | 2021-01-05 20:43:22 +0200 |
|---|---|---|
| committer | Juri Linkov | 2021-01-05 20:43:22 +0200 |
| commit | e72fd12ec688efe046de98d5a6494fe2ffab7762 (patch) | |
| tree | 0ab5f8fe6c29e2c9448c7c18177c75d20b7a7bb8 | |
| parent | c1daeb4c2826af28311a08100e98948349715c37 (diff) | |
| download | emacs-e72fd12ec688efe046de98d5a6494fe2ffab7762.tar.gz emacs-e72fd12ec688efe046de98d5a6494fe2ffab7762.zip | |
* lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556)
| -rw-r--r-- | lisp/tab-bar.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 93f3c550ceb..b44fcfa3a02 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -196,6 +196,18 @@ See `tab-bar-mode' for more information." | |||
| 196 | (tab-bar-mode (if (> (frame-parameter nil 'tab-bar-lines) 0) 0 1)) | 196 | (tab-bar-mode (if (> (frame-parameter nil 'tab-bar-lines) 0) 0 1)) |
| 197 | (tab-bar-mode arg))) | 197 | (tab-bar-mode arg))) |
| 198 | 198 | ||
| 199 | (defun toggle-frame-tab-bar (&optional frame) | ||
| 200 | "Toggle tab bar of FRAME. | ||
| 201 | This is useful when you want to enable the tab bar individually | ||
| 202 | on each new frame when the global `tab-bar-mode' is disabled, | ||
| 203 | or when you want to disable the tab bar individually on each | ||
| 204 | new frame when the global `tab-bar-mode' is enabled, by using | ||
| 205 | |||
| 206 | (add-hook 'after-make-frame-functions 'toggle-frame-tab-bar)" | ||
| 207 | (interactive) | ||
| 208 | (set-frame-parameter frame 'tab-bar-lines | ||
| 209 | (if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1))) | ||
| 210 | |||
| 199 | (defvar tab-bar-map (make-sparse-keymap) | 211 | (defvar tab-bar-map (make-sparse-keymap) |
| 200 | "Keymap for the tab bar. | 212 | "Keymap for the tab bar. |
| 201 | Define this locally to override the global tab bar.") | 213 | Define this locally to override the global tab bar.") |