Function: tab-bar-mouse-move-tab

tab-bar-mouse-move-tab is an interactive and byte-compiled function defined in tab-bar.el.gz.

Signature

(tab-bar-mouse-move-tab EVENT)

Documentation

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

This command should be bound to a drag event. It moves the tab at the mouse-down event to the position at mouse-up event.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-mouse-move-tab (event)
  "Move a tab to a different position on the tab bar.
This command should be bound to a drag event.  It moves the tab
at the mouse-down event to the position at mouse-up event."
  (interactive "e")
  (setq tab-bar--dragging-in-progress nil)
  (let ((from (tab-bar--key-to-number
               (nth 0 (tab-bar--event-to-item
                       (event-start event)))))
        (to (tab-bar--key-to-number
             (nth 0 (tab-bar--event-to-item
                     (event-end event))))))
    (unless (or (eq from to) (eq from t) (eq to t))
      (tab-bar-move-tab-to
       (if (null to) (1+ (tab-bar--current-tab-index)) to) from))))