Function: tab-bar-history-mode

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

Signature

(tab-bar-history-mode &optional ARG)

Documentation

Toggle tab history mode for the tab bar.

Tab history mode remembers window configurations used in every tab, and can restore them.

This is a global minor mode. If called interactively, toggle the Tab-Bar-History 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 (default-value \=tab-bar-history-mode)'.

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

C-c <left> tab-bar-history-back(var)/tab-bar-history-back(fun)
C-c <right> tab-bar-history-forward(var)/tab-bar-history-forward(fun)

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(define-minor-mode tab-bar-history-mode
  "Toggle tab history mode for the tab bar.
Tab history mode remembers window configurations used in every tab,
and can restore them."
  :global t :group 'tab-bar
  (if tab-bar-history-mode
      (progn
        (require 'icons)

        (unless (iconp 'tab-bar-back)
          (define-icon tab-bar-back nil
            `((image "symbols/chevron_left_16.svg" "tabs/left-arrow.xpm"
                     :height (1 . em)
                     :margin ,tab-bar-button-margin
                     :ascent center)
              (text " < "))
            "Icon for going back in tab history."
            :version "29.1"))
        (setq tab-bar-back-button (icon-string 'tab-bar-back))

        (unless (iconp 'tab-bar-forward)
          (define-icon tab-bar-forward nil
            `((image "symbols/chevron_right_16.svg" "tabs/right-arrow.xpm"
                     :height (1 . em)
                     :margin ,tab-bar-button-margin
                     :ascent center)
              (text " > "))
            "Icon for going forward in tab history."
            :version "29.1"))
        (setq tab-bar-forward-button (icon-string 'tab-bar-forward))

        (add-hook 'pre-command-hook #'tab-bar--history-pre-change)
        (add-hook 'window-configuration-change-hook #'tab-bar--history-change))
    (remove-hook 'pre-command-hook #'tab-bar--history-pre-change)
    (remove-hook 'window-configuration-change-hook #'tab-bar--history-change)))