]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el (tab-bar-select-tab): Add check for wc-frame (bug#51883).
authorJuri Linkov <juri@linkov.net>
Tue, 16 Nov 2021 20:45:33 +0000 (22:45 +0200)
committerJuri Linkov <juri@linkov.net>
Tue, 16 Nov 2021 20:45:33 +0000 (22:45 +0200)
lisp/tab-bar.el

index 9fba70f34da2eff8e549441be0df854569715002..871ed1c9817dae54922d34b85033fd9d22a9a3f9 100644 (file)
@@ -1096,7 +1096,11 @@ Negative TAB-NUMBER counts tabs from the end of 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)))