Function: tab-bar-new-tab

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

Signature

(tab-bar-new-tab &optional ARG FROM-NUMBER)

Documentation

Create a new tab ARG positions to the right.

If a negative ARG, create a new tab ARG positions to the left. If ARG is zero, create a new tab in place of the current tab. If no ARG is specified, then add a new tab at the position specified by tab-bar-new-tab-to(var)/tab-bar-new-tab-to(fun). Argument addressing is relative in contrast to tab-bar-new-tab-to(var)/tab-bar-new-tab-to(fun), where argument addressing is absolute. If FROM-NUMBER is a tab number, a new tab is created from that tab.

Key Bindings

Aliases

tab-new

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-new-tab (&optional arg from-number)
  "Create a new tab ARG positions to the right.
If a negative ARG, create a new tab ARG positions to the left.
If ARG is zero, create a new tab in place of the current tab.
If no ARG is specified, then add a new tab at the position
specified by `tab-bar-new-tab-to'.
Argument addressing is relative in contrast to `tab-bar-new-tab-to',
where argument addressing is absolute.
If FROM-NUMBER is a tab number, a new tab is created from that tab."
  (interactive "P")
  (when from-number
    (let ((inhibit-message t))
      (tab-bar-select-tab from-number)))
  (if arg
      (let* ((tabs (funcall tab-bar-tabs-function))
             (from-index (or (tab-bar--current-tab-index tabs) 0))
             (to-index (+ from-index (prefix-numeric-value arg))))
        (tab-bar-new-tab-to (1+ to-index)))
    (tab-bar-new-tab-to)))