Function: tab-bar--format-tab-group

tab-bar--format-tab-group is a byte-compiled function defined in tab-bar.el.gz.

Signature

(tab-bar--format-tab-group TAB I &optional CURRENT-P)

Documentation

Format TAB as a tab that represents a group of tabs.

The argument I is the tab index, and CURRENT-P is non-nil when the tab is current. Return the result as a keymap.

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar--format-tab-group (tab i &optional current-p)
  "Format TAB as a tab that represents a group of tabs.
The argument I is the tab index, and CURRENT-P is non-nil
when the tab is current.  Return the result as a keymap."
  (append
   `((,(intern (format "sep-%i" i)) menu-item ,(tab-bar-separator) ignore))
   `((,(intern (if current-p "current-group" (format "group-%i" i)))
      menu-item
      ,(if current-p
           (condition-case nil
               (funcall tab-bar-tab-group-format-function tab i current-p)
             ;; We used to define tab-bar-tab-group-format-function as
             ;; taking two arguments but after adding the third argument
             ;; we need to provide backwards-compatibility.
             (wrong-number-of-arguments
              (propertize (funcall tab-bar-tab-group-function tab)
                          'face 'tab-bar-tab-group-current)))
         (funcall tab-bar-tab-group-format-function tab i))
      ,(if current-p 'ignore
         (or
          (alist-get 'binding tab)
          `(lambda ()
             (interactive)
             (tab-bar-select-tab ,i))))
      :help "Click to visit group"))))