Skip to content

Hide frame instead of deleting#17

Open
GeorgeBekh wants to merge 6 commits into
alphapapa:masterfrom
GeorgeBekh:master
Open

Hide frame instead of deleting#17
GeorgeBekh wants to merge 6 commits into
alphapapa:masterfrom
GeorgeBekh:master

Conversation

@GeorgeBekh

@GeorgeBekh GeorgeBekh commented Nov 28, 2019

Copy link
Copy Markdown

This way frame will preserve its state

@GeorgeBekh

GeorgeBekh commented Nov 28, 2019

Copy link
Copy Markdown
Author

make-frame-names-alist returns only visible frames, so i couldn't implement this feature with it

@GeorgeBekh

Copy link
Copy Markdown
Author

Right now it's kind of inconvenient, when you start doing something more complex than just one window (e.g eshell + magit) in this popup and then it's all gone :)

@alphapapa

Copy link
Copy Markdown
Owner

Hi George,

Thanks, but I'm not sure I understand the idea here. I do understand that resetting the frame state could be undesired in some cases, but don't the buffer-fns reset the frame state when the frame is created, anyway? Could you give me an example of your configuration in which this would be preferred?

Also, have you considered if any side effects might be caused by changing this? Would it be better to make this behavior optional, or would it matter?

Thanks.

@GeorgeBekh

GeorgeBekh commented Dec 2, 2019

Copy link
Copy Markdown
Author

Hi,
The buffer-fns doesn't reset the frame state per se. It just creates a new frame. And the new frame is created only when there's no frame at all. So if the frame is just invisible the buffer-fns is not called.
The reset happens when the frame is deleted (on toggle when focused).
My pull request removes that behaviour and using make-frame-(in)visible makes toggle more like focus\unfocus, which is already implemented (except that unfocus doesn't hide frames from the window manager). So i don't think there should be any side effects

@GeorgeBekh

Copy link
Copy Markdown
Author

With this pull request, basically, you can't delete a frame (with a yequake-toggle) once you've created it.

I think this behaviour should be default. Like in yaquake: when you open a few tabs and focus on specific one, after you close and open yaquake - your tabs are still there and it's focused on the last one you worked with.

Same should be true with eshells in yequake. I have multiple eshell buffers and i expect yequake to remember the last eshell buffer i worked with.

If the frame is deleted on each toggle the buffer i always see is the *eshell* buffer (given that my buffer function is eshell) while i might be working with the buffer *eshell*<3>

@alphapapa

Copy link
Copy Markdown
Owner

Sorry for not following up on this PR (I'm going through a list of old ones in chronological order).

I don't want to change the default behavior, because it would break the way I use the package.

I have no objection to adding this behavior as an option for each configured frame. However, we would need to consider: What happens if the user closes all frames except hidden ones? Does Emacs exit, or does it remain running, hidden?

And are there any potential issues with having hidden frames hanging around? For example, I've since written the Burly package, and it has commands to save and restore frames. I might need to make it ignore hidden frames, and I can do that, but what about other packages that act on frames? Would they be likely to have problems with hidden frames?

What do you think? Thanks.

@alphapapa alphapapa added enhancement New feature or request question Further information is requested labels Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants