add support for handling cloned indirect buffers#129
Open
dankessler wants to merge 1 commit intoBad-ptr:masterfrom
Open
add support for handling cloned indirect buffers#129dankessler wants to merge 1 commit intoBad-ptr:masterfrom
dankessler wants to merge 1 commit intoBad-ptr:masterfrom
Conversation
Currently, if a user clones a buffer (with e.g., 'clone-indirect-buffer'), the new clone will not be added to the current workspace. Add new customizable option to allow user to specify what should be done when an indirect buffer is created via cloning. By default (t or non-nil), if a buffer is created via cloning, it is added to the current perspective only if its associated base-buffer is also in the current perspective. Option can be set to nil to never automatically add clone indirect buffers, or to 'always to add a clone to the current perspective regardless of whether the base-buffer is in the current perspective.
Author
|
After using the patched version for a bit, I realize that this does not improve the behavior of indirect buffers created using Org-Mode's convenience functions (e.g., |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, if a user clones a buffer (with e.g., 'clone-indirect-buffer'), the
new clone will not be added to the current perspective.
This can be a little surprising: suppose I'm working on buffer native.txt in my current perspective and I call
clone-indirect-buffer. I'll now havenative.txt<2>displayed, but it is not in the current perspective.I think the most reasonable behavior is for persp-mode to automatically add freshly cloned indirect buffers to the current workspace if the base-buffer is already in the current perspective (e.g.., if you are temporarily displaying buffer
foreign.txtand then clone it, the new cloneforeig.txt<2>probably should respect your wishes and not add itself to the current workspace).However, I appreciate that users will have different tastes, so I've added a new customization option so they can restore the old behavior (nil), use what I think is the most natural behavior (t, the new default), or can set it to ('always') so that cloning always adds the newly cloned indirect buffer to the current perspective regardless of whether the base-buffer is a member or not.
I'm open to changing the default to nil, which would retain the "old" behavior and avoid annoying anyone that was relying on it, but I suspect there aren't many people who clone buffers that do not want them added to the current workspace.