TL;DR: please add a hook at the beginning of persp-save-state-to-file, so users can synchronize copy frame parameters (and other info) into current perspective's parameters before saving perspectives to file.
In Spacemacs, we have some integration between Eyebrowse and persp-mode, that lets us have different different eyebrowse workspaces for each perspective (the workspaces are "perspective-local"). Eyebrowse stores its workspaces as frame parameters, and for the integration we (Spacemacs) store the workspaces as perspective parameters. Every time the workspace or the perspective changes, we synchronize between the frame parameters and the perspective parameters, thus we have perspective-local workspaces. All of this is done through Eyebrowse and persp-mode hooks (which are great, by the way š).
An unexpected win is that the workspaces persist between sessions (awesome!), except for two issues:
after loading perspectives from file, the saved workspaces are loaded for the current perspective.
changes to the current workspace of the current layout are not synchronized before saving perspectives to file.
The first issue I could fix by using persp-after-load-state-functions, but for the second issue I had to use a :before advice for persp-save-state-to-file. Using advice is of course risky, because upstream changes might break the advice, but I couldn't find any hook that satisfies our needs. Hence my feature request: please add a hook that runs at the beginning of persp-save-state-to-file.
TL;DR: please add a hook at the beginning of
persp-save-state-to-file
, so users can synchronize copy frame parameters (and other info) into current perspective's parameters before saving perspectives to file.In Spacemacs, we have some integration between Eyebrowse and persp-mode, that lets us have different different eyebrowse workspaces for each perspective (the workspaces are "perspective-local"). Eyebrowse stores its workspaces as frame parameters, and for the integration we (Spacemacs) store the workspaces as perspective parameters. Every time the workspace or the perspective changes, we synchronize between the frame parameters and the perspective parameters, thus we have perspective-local workspaces. All of this is done through Eyebrowse and persp-mode hooks (which are great, by the way š).
An unexpected win is that the workspaces persist between sessions (awesome!), except for two issues:
The first issue I could fix by using
persp-after-load-state-functions
, but for the second issue I had to use a:before
advice forpersp-save-state-to-file
. Using advice is of course risky, because upstream changes might break the advice, but I couldn't find any hook that satisfies our needs. Hence my feature request: please add a hook that runs at the beginning ofpersp-save-state-to-file
.If you want to see the actual code that I'm talking about (not merged yet), see this PR: https://github.com/syl20bnr/spacemacs/pull/7231/files