Function: tab-bar-mode

tab-bar-mode is an interactive and byte-compiled function defined in tab-bar.el.gz.

Signature

(tab-bar-mode &optional ARG)

Documentation

Toggle the tab bar in all graphical frames (Tab Bar mode).

When this mode is enabled, Emacs displays a tab bar on top of each frame. The tab bar is a row of tabs -- buttons that you can click to switch the frame between different window configurations. See current-window-configuration for more about window configurations. To add a button (which can then record one more window configuration), click on the "+" button. Clicking on the "x" icon of a button deletes the button.

If you intend to use tab-bar-mode(var)/tab-bar-mode(fun) with winner-mode(var)/winner-mode(fun), we recommend using tab-bar-history-mode(var)/tab-bar-history-mode(fun) instead, since it provides tab-specific window configuration history, and is better behaved when tab-bar-mode(var)/tab-bar-mode(fun) is turned on.

This is a global minor mode. If called interactively, toggle the Tab-Bar mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable tab-bar-mode(var)/tab-bar-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

View in manual

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(define-minor-mode tab-bar-mode
  "Toggle the tab bar in all graphical frames (Tab Bar mode).

When this mode is enabled, Emacs displays a tab bar on top of each frame.
The tab bar is a row of tabs -- buttons that you can click
to switch the frame between different window configurations.
See `current-window-configuration' for more about window configurations.
To add a button (which can then record one more window configuration),
click on the \"+\" button.  Clicking on the \"x\" icon of a button
deletes the button.

If you intend to use `tab-bar-mode' with `winner-mode', we recommend
using `tab-bar-history-mode' instead, since it provides tab-specific
window configuration history, and is better behaved when `tab-bar-mode'
is turned on."
  :global t
  ;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
  :variable tab-bar-mode

  ;; Recalculate `tab-bar-lines' for all frames
  (tab-bar--update-tab-bar-lines t)

  (when tab-bar-mode
    (tab-bar--load-buttons))
  (if tab-bar-mode
      (tab-bar--define-keys)
    (tab-bar--undefine-keys)))