Function: tab-bar-mouse-down-1

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

Signature

(tab-bar-mouse-down-1 EVENT)

Documentation

Select the tab at mouse click, or add a new tab on the tab bar.

Whether this command adds a new tab or selects an existing tab depends on whether the click is on the "+" button or on an existing tab.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-mouse-down-1 (event)
  "Select the tab at mouse click, or add a new tab on the tab bar.
Whether this command adds a new tab or selects an existing tab
depends on whether the click is on the \"+\" button or on an
existing tab."
  (interactive "e")
  (let* ((item (tab-bar--event-to-item (event-start event)))
         (tab-number (tab-bar--key-to-number (nth 0 item))))
    (setq tab-bar--dragging-in-progress t)
    ;; Don't close the tab when clicked on the close button.  Also
    ;; don't add new tab on down-mouse.  Let `tab-bar-mouse-1' do this.
    (unless (or (memq (car item) '(add-tab history-back history-forward global))
                (nth 2 item))
      (if (functionp (nth 1 item))
          (call-interactively (nth 1 item))
        (unless (eq tab-number t)
          (tab-bar-select-tab tab-number))))))