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

bufler-list-buffer-switch does not respect window cofiguration #76

Closed
jmburgos opened this issue Oct 7, 2021 · 10 comments
Closed

bufler-list-buffer-switch does not respect window cofiguration #76

jmburgos opened this issue Oct 7, 2021 · 10 comments

Comments

@jmburgos
Copy link

jmburgos commented Oct 7, 2021

Hello,

If I split a window in two (or more parts), call bufler in one of them, select a buffer, and call bufler-list-buffer-switch, then the buffer is opened in a single window taking the entire frame. Would it be possible for bufler-list-buffer-switch not to modify the window configuration?

Many thanks!

@alphapapa
Copy link
Owner

Hi Julian,

You can see the code in question here:

(pop-to-buffer buffer '((display-buffer-reuse-window
AFAIK that shouldn't behave as you described, so maybe there's something else going on. Or, if I've misunderstood, and you can recommend a better default value for the pop-to-buffer action argument, please do. Or if we need to make this configurable, that could be done.

Thanks.

@jmburgos
Copy link
Author

jmburgos commented Oct 7, 2021

Thank you. I will do a bit of testing and try to figure out what is going on.

@WorldsEndless
Copy link
Contributor

WorldsEndless commented Oct 16, 2021

Coming from issue 77, this is almost show-stopping behavior. I have no customizations that I am aware of that should effect the action taken, but hitting enter on an item from the bufler list kills the previous window, whether in this frame or another. It doesn't seem to matter what types of buffer are displayed in the old or the new.

@WorldsEndless
Copy link
Contributor

I fixed it in my case. It was a result of the following line, which I can simply remove. However, this must have been there for some reason. Before I pull request, can you provide an explanation for why it was doing any delete-window within bufler-define-buffer-command switch ?

(delete-window bufler-window))

@alphapapa
Copy link
Owner

You could look at the git blame for that line, and the comment preceding it. That code was last changed over 18 months ago, and I was probably the only one using it then, so I was probably just doing whatever seemed to fit my needs best at the time.

Other than that, if you can suggest a fix that ensures that it behaves as desired in all circumstances (or a reasonably comprehensive subset of them), we could make that change. Or it might be necessary to first more clearly define what the command should do.

@WorldsEndless
Copy link
Contributor

I see the blame on there, but I'm still not sure why a function "switch" needs to delete-window at all, unless perhaps there is some external window functionality that needs preserving? I don't use anything like that in my use-case, so I'm not sure what needs to be preserved.

@jcalve
Copy link

jcalve commented Dec 29, 2021

Could we at least have an option to disable this delete-window? I think the behaviour seems strange because in ibuffer the behaviour is the opposite, it only deletes other windows with an optional prefix.

@dcunited001
Copy link

dcunited001 commented Jan 13, 2022

@WorldsEndless @jcalve i think you can also address this by modifying the popup behavior in emacs.

example with doom emacs:

(set-popup-rules!
  '(("^\\*Bufler" :side right :width 60
    :vslot -5 :slot 3
    :modeline nil :select t :quit t))
)

Configuring it without doom emacs was a bit confusing for me at first. once you learn how to customize this, it's alot easier to get buffers to go where you want. The content of set-popup-rules! ends up in the variable display-buffer-alist.

@WorldsEndless
Copy link
Contributor

ping on this. After reinstalling my system a couple times I went in and made the change again, but I've been running withouth that delete-buffer code for over a year. At least in exwm, it makes M-x bufler practically unusable, and simply removing that line makes everything work as expected.

@alphapapa
Copy link
Owner

Thanks to all for your patience and suggestions. I removed the delete-window call and made the action argument an option. Please let me know how that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants