Function: tab-line-switch-to-next-tab

tab-line-switch-to-next-tab is an interactive and byte-compiled function defined in tab-line.el.gz.

Signature

(tab-line-switch-to-next-tab &optional EVENT)

Documentation

Switch to the next tab's buffer.

Its effect is the same as using the next-buffer command
(C-x <right> (next-buffer)).

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-line.el.gz
(defun tab-line-switch-to-next-tab (&optional event)
  "Switch to the next tab's buffer.
Its effect is the same as using the `next-buffer' command
(\\[next-buffer])."
  (interactive (list last-nonmenu-event))
  (let ((window (and (listp event) (posn-window (event-start event)))))
    (if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers)
        (switch-to-next-buffer window)
      (with-selected-window (or window (selected-window))
        (let* ((tabs (seq-filter
                      (lambda (tab) (or (bufferp tab) (assq 'buffer tab)))
                      (funcall tab-line-tabs-function)))
               (pos (seq-position
                     tabs (current-buffer)
                     (lambda (tab buffer)
                       (if (bufferp tab)
                           (eq buffer tab)
                         (eq buffer (cdr (assq 'buffer tab)))))))
               (tab (if pos
                        (if (and tab-line-switch-cycling (<= (length tabs) (1+ pos)))
                            (car tabs)
                          (nth (1+ pos) tabs))))
               (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
          (when (bufferp buffer)
            (switch-to-buffer buffer)))))))