persp-mode.el
persp-mode.el copied to clipboard
[feature-request] Tab-bar-mode integration
allow keeping a distinct set of tabs per-perspective.
from README of https://github.com/nex3/perspective-el
Tab Bar maintains window layouts (with optional names). In this, it is similar to Perspective. Unlike Perspective, it does not support buffer lists. Using Perspective and Tab Bar at the same time is not recommended at this time, since the tab list is global (i.e., will show up in all perspectives) and is likely to cause confusion. It would be an interesting future feature for ?Perspective to adopt the tab bar and allow keeping a distinct set of tabs per-perspective.
Opening a issue similar to https://github.com/nex3/perspective-el/issues/138
(add-hook 'persp-before-deactivate-functions
(defun +workspaces-save-tab-bar-data-h (_)
(when (get-current-persp)
(set-persp-parameter
'tab-bar-tabs (tab-bar-tabs)))))
(add-hook 'persp-activated-functions
(defun +workspaces-load-tab-bar-data-h (_)
(tab-bar-tabs-set (persp-parameter 'tab-bar-tabs))
(tab-bar--update-tab-bar-lines t))))
This snippet has been working for me.
The snippet saves the configuration of tab-bar to files:
(add-hook 'persp-before-save-state-to-file-functions
(defun +workspaces-save-tab-bar-data-to-file-h (&rest _)
(when (get-current-persp)
(set-persp-parameter 'tab-bar-tabs (frameset-filter-tabs (tab-bar-tabs) nil nil t))