diff --git a/lisp/tab-line.el b/lisp/tab-line.el index cc60f94c9c5..12414f0e06f 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -835,31 +849,48 @@ (switch-to-buffer buffer)))))) (defcustom tab-line-switch-cycling nil - "Enable cycling tab switch. + "Wrap tabs on tab switch while cycling. If non-nil, `tab-line-switch-to-prev-tab' in the first tab switches to the last tab and `tab-line-switch-to-next-tab' in the -last tab switches to the first tab. This variable is not consulted -when `tab-line-tabs-function' is `tab-line-tabs-window-buffers'." +last tab switches to the first tab. + +When `tab-line-tabs-function' is `tab-line-tabs-window-buffers', +then you can customize `switch-to-prev-buffer-wrap' to t +to achieve the same wrapping effect." :type 'boolean :group 'tab-line :version "28.1") (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])." +When `tab-line-tabs-function' is `tab-line-tabs-window-buffers', +its effect is the same as using the `previous-buffer' command +\(\\[previous-buffer]). To wrap buffer cycling in this case, +you can customize `switch-to-prev-buffer-wrap'. + +For other values of `tab-line-tabs-function' this command +switches to the previous buffer in the sequence defined by +`tab-line-tabs-function'. To wrap buffer cycling in this case, +you can customize `tab-line-switch-cycling'." (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) @@ -835,31 +849,48 @@ (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])." +When `tab-line-tabs-function' is `tab-line-tabs-window-buffers', +its effect is the same as using the `next-buffer' command +\(\\[next-buffer]). To wrap buffer cycling in this case, +you can customize `switch-to-prev-buffer-wrap'. + +For other values of `tab-line-tabs-function' this command +switches to the next buffer in the sequence defined by +`tab-line-tabs-function'. To wrap buffer cycling in this case, +you can customize `tab-line-switch-cycling'." (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))