]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el (tab-bar-close-other-tabs): Use tab close customs
authorRobert Cochran <robert-git@cochranmail.com>
Wed, 11 Dec 2019 18:29:00 +0000 (10:29 -0800)
committerJuri Linkov <juri@linkov.net>
Sun, 15 Dec 2019 22:55:54 +0000 (00:55 +0200)
lisp/tab-bar.el

index 7e8f56de2a75a03db504f2ec674d062cf9c9368a..e045a778656e4b353e0ae999972a9e648e7e0ce2 100644 (file)
@@ -906,11 +906,18 @@ for the last tab on a frame is determined by
          (current-index (tab-bar--current-tab-index tabs)))
     (when current-index
       (dotimes (index (length tabs))
-        (unless (eq index current-index)
+        (unless (or (eq index current-index)
+                    (run-hook-with-args-until-success
+                     'tab-bar-tab-prevent-close-functions
+                     (nth index tabs)
+                     ; last-tab-p logically can't ever be true if we
+                     ; make it this far
+                     nil))
           (push `((frame . ,(selected-frame))
                   (index . ,index)
                   (tab . ,(nth index tabs)))
-                tab-bar-closed-tabs)))
+                tab-bar-closed-tabs)
+          (run-hook-with-args 'tab-bar-tab-pre-close-functions (nth index tabs) nil)))
       (set-frame-parameter nil 'tabs (list (nth current-index tabs)))
 
       (when (and tab-bar-mode