[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 249095f: Merge from origin/emacs-28
From: |
Stefan Kangas |
Subject: |
master 249095f: Merge from origin/emacs-28 |
Date: |
Wed, 17 Nov 2021 02:21:01 -0500 (EST) |
branch: master
commit 249095fd6778b9014ff30381ca562f40107d7be4
Merge: 90ac2db fa0b34b
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Merge from origin/emacs-28
fa0b34b716 * admin/authors.el (authors-ignored-files): Ignore some NE...
c25be3e7bb * lisp/tab-bar.el (tab-bar-select-tab): Add check for wc-f...
38d905abf9 * lisp/tab-bar.el: Doc fixes for commands bound to modifie...
---
admin/authors.el | 3 ++-
lisp/tab-bar.el | 25 +++++++++++++++++--------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/admin/authors.el b/admin/authors.el
index fd46dab..23990fe 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -323,7 +323,8 @@ Changes to files matching one of the regexps in this list
are not listed.")
"NEWS.unicode" "COPYING.DJ" "Makefile.old" "Makefile.am"
"NEWS.1" "OOOOONEWS...OONEWS" "OOOONEWS" "etc/NEWS"
"NEWS.1-17" "NEWS.18" "NEWS.19" "NEWS.20" "NEWS.21" "NEWS.22"
- "MAINTAINERS" "MH-E-NEWS"
+ "NEWS.23" "NEWS.24" "NEWS.25" "NEWS.26" "NEWS.27" "NEWS.28"
+ "MAINTAINERS" "ERC-NEWS" "MH-E-NEWS" "NXML-NEWS"
"install.sh" "install-sh" "missing" "mkinstalldirs"
"termcap.dat" "termcap.src" "termcap.ucb" "termcap"
"ChangeLog.nextstep" "Emacs.clr" "spec.txt"
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 10f2687..871ed1c 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -91,9 +91,10 @@
(defcustom tab-bar-select-tab-modifiers '()
"List of modifier keys for selecting tab-bar tabs by their numbers.
Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
-`alt'. Pressing one of the modifiers in the list and a digit selects
-the tab whose number equals the digit. Negative numbers count from
-the end of the tab bar. The digit 9 selects the last (rightmost) tab.
+`alt'. Pressing one of the modifiers in the list and a digit selects the
+tab whose number equals the digit (see `tab-bar-select-tab').
+The digit 9 selects the last (rightmost) tab (see `tab-last').
+The digit 0 selects the most recently visited tab (see `tab-recent').
For easier selection of tabs by their numbers, consider customizing
`tab-bar-tab-hints', which will show tab numbers alongside the tab name."
:type '(set :tag "Tab selection modifier keys"
@@ -1060,11 +1061,14 @@ inherits the current tab's `explicit-name' parameter."
(defun tab-bar-select-tab (&optional tab-number)
"Switch to the tab by its absolute position TAB-NUMBER in the tab bar.
-When this command is bound to a numeric key (with a prefix or modifier key
+When this command is bound to a numeric key (with a key prefix or modifier key
using `tab-bar-select-tab-modifiers'), calling it without an argument
will translate its bound numeric key to the numeric argument.
-TAB-NUMBER counts from 1. Negative TAB-NUMBER counts tabs from the end of
-the tab bar."
+Also the prefix argument TAB-NUMBER can be used to override
+the numeric key, so it takes precedence over the bound digit key.
+For example, `<MODIFIER>-2' will select the second tab, but `C-u 15
+<MODIFIER>-2' will select the 15th tab. TAB-NUMBER counts from 1.
+Negative TAB-NUMBER counts tabs from the end of the tab bar."
(interactive "P")
(unless (integerp tab-number)
(let ((key (event-basic-type last-command-event)))
@@ -1092,7 +1096,11 @@ the tab bar."
;; its value of window-configuration is unreadable,
;; so restore its saved window-state.
(cond
- ((window-configuration-p wc)
+ ((and (window-configuration-p wc)
+ ;; Check for such cases as cloning a frame with tabs.
+ ;; When tabs were cloned to another frame, then fall back
+ ;; to using `window-state-put' below.
+ (eq (window-configuration-frame wc) (selected-frame)))
(let ((wc-point (alist-get 'wc-point to-tab))
(wc-bl (seq-filter #'buffer-live-p (alist-get 'wc-bl to-tab)))
(wc-bbl (seq-filter #'buffer-live-p (alist-get 'wc-bbl
to-tab)))
@@ -1161,7 +1169,8 @@ Interactively, ARG is the prefix numeric argument and
defaults to 1."
(defun tab-bar-switch-to-last-tab (&optional arg)
"Switch to the last tab or ARGth tab from the end of the tab bar.
Interactively, ARG is the prefix numeric argument; it defaults to 1,
-which means the last tab on the tab bar."
+which means the last tab on the tab bar. For example, `C-u 2
+<MODIFIER>-9' selects the tab before the last tab."
(interactive "p")
(tab-bar-select-tab (- (length (funcall tab-bar-tabs-function))
(1- (or arg 1)))))