-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add frame global perspective. #178
Conversation
Hmm failed the tests for emacs 24.4. I'll have to figure that out. |
Fixed it :) Turns out the problem was that I also realized I forgot to modify the ido buffer switcher so I got that to work as well. |
Interesting. I see the value in this feature.
|
|
I added a keybinding for As for your request to automatically delete the GLOBAL perspective if it is empty, here are some ideas that all have their own problems:
Would you merge this PR even if the GLOBAL perspective is not deleted automatically? I think it makes more sense to make it clear in the documentation that the GLOBAL perspective is just another perspective and behaves the same as any other. If this is not acceptable then I think the whole PR should be reimplemented by using a frame-parameter instead of a "special" perspective. |
Upon reflection, I'm fine with the global perspective not being deleted automatically. It's an opt-in feature, so users who want it can wrangle with it. (It can be automatically cleaned up with a sufficiently sophisticated I added a bit more documentation, and renamed the main entry point function to Thank you for contributing to Perspective! |
This PR implements a frame global perspective. Any buffer that is a member of the frame global perspective is available for selection when using a perspective aware buffer switcher. Every frame gets its own frame global perspective.
I have been using something like this in my config for a while. It is useful to me because I like to have shell-mode buffers open named
*SHELL-{1,5}*
that I always want to be able to switch to regardless of what perspective I am inThe way I implemented this is by modifying
persp-current-buffers
so that it takes an optional arginclude-global
that if non-nil includes buffers that are members of the perspective namedpersp-frame-global-perspective-name
. Naturally this requires that I also had add the same optional arg topersp-current-buffer-names
,persp-is-current-buffer
,persp-buffer-filter
, andpersp-buffer-list-filter
. I then modified all of the buffer switchers to use this new option.I also added wrappers,
persp-add-frame-global-buffer
,persp-set-frame-global-buffer
,persp-remove-frame-global-perspective
, andpersp-forget-frame-global-perspective
. These all work like their generic counterparts but for the frame global perspective.The name for the frame global perspective is set by the variable
persp-frame-global-perspective-name
, which defaults to "GLOBAL".