From: Juri Linkov Date: Tue, 21 Sep 2021 17:45:38 +0000 (+0300) Subject: * lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs. X-Git-Tag: emacs-28.0.90~768 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5395127626c1caaca8f80edcee77647e6eb9bb0;p=emacs.git * 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 --- diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 4e59508f6d8..d0a1b3b70bf 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))))