Function: tab-bar-close-group-tabs

tab-bar-close-group-tabs is an interactive and byte-compiled function defined in tab-bar.el.gz.

Signature

(tab-bar-close-group-tabs GROUP-NAME)

Documentation

Close all tabs that belong to GROUP-NAME on the selected frame.

Interactively, prompt for GROUP-NAME.

Key Bindings

Aliases

tab-close-group

Source Code

;; Defined in /usr/src/emacs/lisp/tab-bar.el.gz
(defun tab-bar-close-group-tabs (group-name)
  "Close all tabs that belong to GROUP-NAME on the selected frame.
Interactively, prompt for GROUP-NAME."
  (interactive
   (let ((group-name (funcall tab-bar-tab-group-function
                              (tab-bar--current-tab-find))))
     (list (completing-read
            "Close all tabs with group name: "
            (delete-dups
             (delq nil (cons group-name
                             (mapcar (lambda (tab)
                                       (funcall tab-bar-tab-group-function tab))
                                     (funcall tab-bar-tabs-function)))))))))
  (let* ((close-group (and (> (length group-name) 0) group-name))
         (tab-bar-tab-prevent-close-functions
          (cons (lambda (tab _last-tab-p)
                  (not (equal (funcall tab-bar-tab-group-function tab)
                              close-group)))
                tab-bar-tab-prevent-close-functions)))
    (tab-bar-close-other-tabs)

    (when (equal (funcall tab-bar-tab-group-function
                          (tab-bar--current-tab-find))
                 close-group)
      (tab-bar-close-tab))))