This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun custom-tab-line-switch-to-next-tab (&optional mouse-event) | |
"Switch to the next tab - cycle back to the start at the end. | |
Its effect is the same as using the `next-buffer' command | |
(\\[next-buffer]). with the exception it will not open a non-visible buffer" | |
(interactive (list last-nonmenu-event)) | |
(let ((window (and (listp mouse-event) (posn-window (event-start mouse-event))))) | |
(with-selected-window (or window (selected-window)) | |
(let* ((tabs (funcall tab-line-tabs-function)) | |
(tab-buffers (mapcar (lambda (tab) (if (bufferp tab) tab (cdr (assq 'buffer tab)))) tabs)) | |
(num-tabs (length tab-buffers)) |