persp-mode.el icon indicating copy to clipboard operation
persp-mode.el copied to clipboard

[feature-request] Tab-bar-mode integration

Open CsBigDataHub opened this issue 4 years ago • 3 comments

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

CsBigDataHub avatar Dec 15 '20 19:12 CsBigDataHub

  (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.

LemonBreezes avatar Aug 23 '22 21:08 LemonBreezes

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))

roife avatar Dec 23 '22 14:12 roife