Function: tab-bar-move-tab

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

Signature

(tab-bar-move-tab &optional ARG)

Documentation

Move the current tab ARG positions to the right.

Interactively, ARG is the prefix numeric argument and defaults to 1. If ARG is negative, move the current tab ARG positions to the left. Argument addressing is relative in contrast to tab-bar-move-tab-to, where argument addressing is absolute.

Key Bindings

Aliases

tab-move

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-move-tab (&optional arg)
  "Move the current tab ARG positions to the right.
Interactively, ARG is the prefix numeric argument and defaults to 1.
If ARG is negative, move the current tab ARG positions to the left.
Argument addressing is relative in contrast to `tab-bar-move-tab-to',
where argument addressing is absolute."
  (interactive "p")
  (let* ((tabs (funcall tab-bar-tabs-function))
         (from-index (or (tab-bar--current-tab-index tabs) 0))
         (to-index (mod (+ from-index arg) (length tabs))))
    (tab-bar-move-tab-to (1+ to-index) (1+ from-index))))