[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b539512: * lisp/tab-bar.el: Preserve all existing tab parameters
From: |
Juri Linkov |
Subject: |
master b539512: * lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs. |
Date: |
Tue, 21 Sep 2021 13:46:43 -0400 (EDT) |
branch: master
commit b5395127626c1caaca8f80edcee77647e6eb9bb0
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
* lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs.
* lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab-make):
Copy other possible tab parameters.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01544.html
---
lisp/tab-bar.el | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 4e59508..d0a1b3b 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -902,7 +902,8 @@ on the tab bar instead."
(if (consp current)
(seq-reduce (lambda (current param)
(assq-delete-all param current))
- '(wc wc-point wc-bl wc-bbl wc-history-back
wc-history-forward)
+ '(wc wc-point wc-bl wc-bbl
+ wc-history-back wc-history-forward)
(copy-sequence current))
current))
current)
@@ -914,8 +915,10 @@ on the tab bar instead."
(let* ((tab (tab-bar--current-tab-find nil frame))
(tab-explicit-name (alist-get 'explicit-name tab))
(tab-group (alist-get 'group tab))
- (bl (seq-filter #'buffer-live-p (frame-parameter frame
'buffer-list)))
- (bbl (seq-filter #'buffer-live-p (frame-parameter frame
'buried-buffer-list))))
+ (bl (seq-filter #'buffer-live-p (frame-parameter
+ frame 'buffer-list)))
+ (bbl (seq-filter #'buffer-live-p (frame-parameter
+ frame 'buried-buffer-list))))
`(tab
(name . ,(if tab-explicit-name
(alist-get 'name tab)
@@ -929,8 +932,18 @@ on the tab bar instead."
(wc-point . ,(point-marker))
(wc-bl . ,bl)
(wc-bbl . ,bbl)
- (wc-history-back . ,(gethash (or frame (selected-frame))
tab-bar-history-back))
- (wc-history-forward . ,(gethash (or frame (selected-frame))
tab-bar-history-forward)))))
+ (wc-history-back . ,(gethash (or frame (selected-frame))
+ tab-bar-history-back))
+ (wc-history-forward . ,(gethash (or frame (selected-frame))
+ tab-bar-history-forward))
+ ;; Copy other possible parameters
+ ,@(mapcan (lambda (param)
+ (unless (memq (car param)
+ '(name explicit-name group time
+ ws wc wc-point wc-bl wc-bbl
+ wc-history-back wc-history-forward))
+ (list param)))
+ (cdr tab)))))
(defun tab-bar--current-tab (&optional tab frame)
(tab-bar--current-tab-make (or tab (tab-bar--current-tab-find nil frame))))
@@ -950,7 +963,15 @@ on the tab bar instead."
(alist-get 'name tab)
(funcall tab-bar-tab-name-function)))
(explicit-name . ,tab-explicit-name)
- ,@(if tab-group `((group . ,tab-group))))))
+ ,@(if tab-group `((group . ,tab-group)))
+ ;; Copy other possible parameters
+ ,@(mapcan (lambda (param)
+ (unless (memq (car param)
+ '(name explicit-name group time
+ ws wc wc-point wc-bl wc-bbl
+ wc-history-back wc-history-forward))
+ (list param)))
+ (cdr tab)))))
(defun tab-bar--current-tab-find (&optional tabs frame)
(assq 'current-tab (or tabs (funcall tab-bar-tabs-function frame))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b539512: * lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs.,
Juri Linkov <=