Function: tab-line-switch-to-prev-tab

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

Signature

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

Documentation

Switch to the previous tab's buffer.

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

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-line.el.gz
(defun tab-line-switch-to-prev-tab (&optional event)
  "Switch to the previous tab's buffer.
Its effect is the same as using the `previous-buffer' command
(\\[previous-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-prev-buffer window)
      (with-selected-window (or window (selected-window))
        (let* ((tabs (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 (<= pos 0))
                            (nth (1- (length tabs)) tabs)
                          (nth (1- pos) tabs))))
               (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
          (when (bufferp buffer)
            (switch-to-buffer buffer)))))))