Function: tab-line-move-tab-forward

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

Signature

(tab-line-move-tab-forward &optional ARG)

Documentation

Move a tab to a different position on the tab line.

ARG specifies the number of positions to move:
- When positive, move the current tab ARG positions to the right.
- When negative, move the current tab -ARG positions to the left.
- When nil, act as if ARG is 1, moving one position to the right.
It can be used only when tab-line-tabs-function is customized to tab-line-tabs-fixed-window-buffers.

Probably introduced at or before Emacs version 31.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-line.el.gz
(defun tab-line-move-tab-forward (&optional arg)
  "Move a tab to a different position on the tab line.
ARG specifies the number of positions to move:
- When positive, move the current tab ARG positions to the right.
- When negative, move the current tab -ARG positions to the left.
- When nil, act as if ARG is 1, moving one position to the right.
It can be used only when `tab-line-tabs-function' is
customized to `tab-line-tabs-fixed-window-buffers'."
  (interactive "p")
  (when (eq tab-line-tabs-function #'tab-line-tabs-fixed-window-buffers)
    (let* ((window (selected-window))
           (buffers (window-parameter window 'tab-line-buffers))
           (buffer (current-buffer))
           (pos (seq-position buffers buffer))
           (len (length buffers))
           (new-pos (+ pos (or arg 1))))
      (when (and pos (> len 1))
        (setq new-pos (if tab-line-switch-cycling
                          (mod new-pos len)
                        (max 0 (min new-pos (1- len)))))
        (setq buffers (delq buffer buffers))
        (setq buffers (append
                       (seq-take buffers new-pos)
                       (list buffer)
                       (seq-drop buffers new-pos)))
        (set-window-parameter window 'tab-line-buffers buffers)
        (set-window-parameter window 'tab-line-cache nil)
        (force-mode-line-update)))))