Function: tab-bar-mouse-1

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

Signature

(tab-bar-mouse-1 EVENT)

Documentation

Close the tab whose "x" close button you click.

See also tab-bar-mouse-close-tab, which closes the tab regardless of where you click on it. Also add a new tab.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-mouse-1 (event)
  "Close the tab whose \"x\" close button you click.
See also `tab-bar-mouse-close-tab', which closes the tab
regardless of where you click on it.  Also add a new tab."
  (interactive "e")
  (let* ((item (tab-bar--event-to-item (event-start event)))
         (tab-number (tab-bar--key-to-number (nth 0 item))))
    (cond
     ((and (memq (car item) '(add-tab history-back history-forward global))
           (not (eq (nth 1 item) 'tab-bar-mouse-1))
           (functionp (nth 1 item)))
      (call-interactively (nth 1 item)))
     ((and (nth 2 item) (not (eq tab-number t)))
      (tab-bar-close-tab tab-number)))))