Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have winner-mode work separately for each layout #6253

Closed
honkhonkhonk opened this issue Jun 7, 2016 · 4 comments
Closed

have winner-mode work separately for each layout #6253

honkhonkhonk opened this issue Jun 7, 2016 · 4 comments

Comments

@honkhonkhonk
Copy link

I find working with layouts frustrating since I frequently use winner-mode to switch buffers. Currently winner-undo opens the previous window configuration even if it's from a different layout.

I would really like to have winner-undo/redo track a separate buffer history for each layout.

@TheBB
Copy link
Collaborator

TheBB commented Jun 7, 2016

CC @bmag :-)

@syl20bnr
Copy link
Owner

syl20bnr commented Jun 7, 2016

I thought the same as @TheBB when reading this :-)

@bmag
Copy link
Collaborator

bmag commented Jun 7, 2016

Steps necessary to have winner-mode track separate buffer/window history for each layout:

  • identify the variables, and possibly frame parameters, that winner-mode uses to keep track of changes in window configurations. Lets call these variables the "state" of winner-mode.
  • add hooks:
    • save state as perspective parameters (set-persp-parameter) before changing layout (use persp-before-switch-functions)
    • load state (persp-parameter) after changing layout (use persp-activated-functions)
    • if winner-mode's state should persist between sessions (it probably shouldn't): save state as perspective parameters before saving layouts to file
  • the same layout can be used in more than one frame, so each layout should save one winner-mode state for terminal frames and a different winner-mode state for graphical frames
  • it seems that winner-mode stores different histories for different frames - each layout should only save and restore the winner-mode state that is relevant to the layout's frame. In other words, don't change state of other frames when loading a layout's winner-mode state.

If we also want separate winner-mode histories for different workspaces (within a layout):

  • save workspace's state as perspective parameters before changing workspace or layout (eyebrowse-pre-window-switch-hook, persp-before-switch-functions)
  • load workspace's state from perspective parameters after changing workspace or layout (eyebrowse-post-window-switch-hook, persp-activated-functions)

Implementing this will require some effort, and the code could be messy. I think it would help to have an external package that makes features local to layouts (perspectives) or workspaces. If I'll have the time, I might write such a package - but is's unlikely to happen before July/August.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@lebensterben lebensterben removed stale marked as a stale issue/pr (usually by a bot) Feature request labels Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Forum
  
To close
Development

No branches or pull requests

6 participants