[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 7397f2099b: * lisp/tab-bar.el: Keep tabs of the same group toge
From: |
Juri Linkov |
Subject: |
emacs-29 7397f2099b: * lisp/tab-bar.el: Keep tabs of the same group together (bug#59721) |
Date: |
Wed, 30 Nov 2022 14:38:14 -0500 (EST) |
branch: emacs-29
commit 7397f2099b6c2053c5996e8679b6e2856224569b
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
* lisp/tab-bar.el: Keep tabs of the same group together (bug#59721)
(tab-bar-tab-post-change-group-functions): Change the default value to
'(tab-bar-move-tab-to-group)'. Improve docstring.
(tab-bar-change-tab-group): Improve docstring.
---
lisp/tab-bar.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index f77f7492c3..2f8e8b2934 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1920,13 +1920,16 @@ function `tab-bar-tab-name-function'."
(when pos
(tab-bar-move-tab-to pos (1+ tab-index)))))
-(defcustom tab-bar-tab-post-change-group-functions nil
+(defcustom tab-bar-tab-post-change-group-functions '(tab-bar-move-tab-to-group)
"List of functions to call after changing a tab group.
-The current tab is supplied as an argument."
+This hook is run at the end of the function `tab-bar-change-tab-group'.
+The current tab is supplied as an argument. You can use any function,
+but by default it enables the function `tab-bar-move-tab-to-group'
+that moves the tab closer to its group."
:type 'hook
:options '(tab-bar-move-tab-to-group)
:group 'tab-bar
- :version "28.1")
+ :version "29.1")
(defun tab-bar-change-tab-group (group-name &optional tab-number)
"Add the tab specified by its absolute position TAB-NUMBER to GROUP-NAME.
@@ -1937,7 +1940,8 @@ TAB-NUMBER counts from 1.
If GROUP-NAME is the empty string, then remove the tab from any group.
While using this command, you might also want to replace
`tab-bar-format-tabs' with `tab-bar-format-tabs-groups' in
-`tab-bar-format' to group tabs on the tab bar."
+`tab-bar-format' to group tabs on the tab bar.
+At the end it runs the hook `tab-bar-tab-post-change-group-functions'."
(interactive
(let* ((tabs (funcall tab-bar-tabs-function))
(tab-number (or current-prefix-arg
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 7397f2099b: * lisp/tab-bar.el: Keep tabs of the same group together (bug#59721),
Juri Linkov <=