Function: tab-bar-format-list

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

Signature

(tab-bar-format-list FORMAT-LIST)

Documentation

Return a list of items formatted from format-list.

The item tab-bar-format-align-right has special formatting.

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-format-list (format-list)
  "Return a list of items formatted from `format-list'.
The item `tab-bar-format-align-right' has special formatting."
  (let* ((i 0) align-right-p rest
         (res (apply #'append
                     (mapcar
                      (lambda (format)
                        (setq i (1+ i))
                        (cond
                         ((eq format 'tab-bar-format-align-right)
                          (setq align-right-p t)
                          (list format))
                         ((functionp format)
                          (let ((ret (funcall format)))
                            (when (stringp ret)
                              (setq ret `((,(intern (format "str-%i" i))
                                           menu-item ,ret ignore))))
                            (when align-right-p
                              (setq rest (append rest ret)))
                            ret))))
                      format-list))))
    (when align-right-p
      (setq res (mapcan (lambda (format)
                          (if (eq format 'tab-bar-format-align-right)
                              (tab-bar-format-align-right rest)
                            (list format)))
                        res)))
    res))