diff options
| -rw-r--r-- | lisp/tab-bar.el | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 10f26875db5..9fba70f34da 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -91,9 +91,10 @@ | |||
| 91 | (defcustom tab-bar-select-tab-modifiers '() | 91 | (defcustom tab-bar-select-tab-modifiers '() |
| 92 | "List of modifier keys for selecting tab-bar tabs by their numbers. | 92 | "List of modifier keys for selecting tab-bar tabs by their numbers. |
| 93 | Possible modifier keys are `control', `meta', `shift', `hyper', `super' and | 93 | Possible modifier keys are `control', `meta', `shift', `hyper', `super' and |
| 94 | `alt'. Pressing one of the modifiers in the list and a digit selects | 94 | `alt'. Pressing one of the modifiers in the list and a digit selects the |
| 95 | the tab whose number equals the digit. Negative numbers count from | 95 | tab whose number equals the digit (see `tab-bar-select-tab'). |
| 96 | the end of the tab bar. The digit 9 selects the last (rightmost) tab. | 96 | The digit 9 selects the last (rightmost) tab (see `tab-last'). |
| 97 | The digit 0 selects the most recently visited tab (see `tab-recent'). | ||
| 97 | For easier selection of tabs by their numbers, consider customizing | 98 | For easier selection of tabs by their numbers, consider customizing |
| 98 | `tab-bar-tab-hints', which will show tab numbers alongside the tab name." | 99 | `tab-bar-tab-hints', which will show tab numbers alongside the tab name." |
| 99 | :type '(set :tag "Tab selection modifier keys" | 100 | :type '(set :tag "Tab selection modifier keys" |
| @@ -1060,11 +1061,14 @@ inherits the current tab's `explicit-name' parameter." | |||
| 1060 | 1061 | ||
| 1061 | (defun tab-bar-select-tab (&optional tab-number) | 1062 | (defun tab-bar-select-tab (&optional tab-number) |
| 1062 | "Switch to the tab by its absolute position TAB-NUMBER in the tab bar. | 1063 | "Switch to the tab by its absolute position TAB-NUMBER in the tab bar. |
| 1063 | When this command is bound to a numeric key (with a prefix or modifier key | 1064 | When this command is bound to a numeric key (with a key prefix or modifier key |
| 1064 | using `tab-bar-select-tab-modifiers'), calling it without an argument | 1065 | using `tab-bar-select-tab-modifiers'), calling it without an argument |
| 1065 | will translate its bound numeric key to the numeric argument. | 1066 | will translate its bound numeric key to the numeric argument. |
| 1066 | TAB-NUMBER counts from 1. Negative TAB-NUMBER counts tabs from the end of | 1067 | Also the prefix argument TAB-NUMBER can be used to override |
| 1067 | the tab bar." | 1068 | the numeric key, so it takes precedence over the bound digit key. |
| 1069 | For example, `<MODIFIER>-2' will select the second tab, but `C-u 15 | ||
| 1070 | <MODIFIER>-2' will select the 15th tab. TAB-NUMBER counts from 1. | ||
| 1071 | Negative TAB-NUMBER counts tabs from the end of the tab bar." | ||
| 1068 | (interactive "P") | 1072 | (interactive "P") |
| 1069 | (unless (integerp tab-number) | 1073 | (unless (integerp tab-number) |
| 1070 | (let ((key (event-basic-type last-command-event))) | 1074 | (let ((key (event-basic-type last-command-event))) |
| @@ -1161,7 +1165,8 @@ Interactively, ARG is the prefix numeric argument and defaults to 1." | |||
| 1161 | (defun tab-bar-switch-to-last-tab (&optional arg) | 1165 | (defun tab-bar-switch-to-last-tab (&optional arg) |
| 1162 | "Switch to the last tab or ARGth tab from the end of the tab bar. | 1166 | "Switch to the last tab or ARGth tab from the end of the tab bar. |
| 1163 | Interactively, ARG is the prefix numeric argument; it defaults to 1, | 1167 | Interactively, ARG is the prefix numeric argument; it defaults to 1, |
| 1164 | which means the last tab on the tab bar." | 1168 | which means the last tab on the tab bar. For example, `C-u 2 |
| 1169 | <MODIFIER>-9' selects the tab before the last tab." | ||
| 1165 | (interactive "p") | 1170 | (interactive "p") |
| 1166 | (tab-bar-select-tab (- (length (funcall tab-bar-tabs-function)) | 1171 | (tab-bar-select-tab (- (length (funcall tab-bar-tabs-function)) |
| 1167 | (1- (or arg 1))))) | 1172 | (1- (or arg 1))))) |