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

Retaining window purpose even after last associated buffer has been closed? #192

Open
anlsh opened this issue Mar 18, 2023 · 0 comments
Open

Comments

@anlsh
Copy link

anlsh commented Mar 18, 2023

Is it possible to retain a window's purpose even after the last buffer of that purpose has been closed?

Let's say that I have three windows: 1, 2, and 3. My aim is to set up the first to display rustic-mode buffers, have the second as miscellaneous, and have the third display rustic-compilation buffers.

So let's say I set up those three windows without purpose-mode enabled. Then, running rustic-cargo-build will build my project and display its output in some new/fourth popup buffer that I don't really like. So I'm trying to set up a window layout to avoid that.

So, suppose I redo my window layout to have three windows again, but this time with the following configuration.

(add-to-list 'purpose-user-mode-purposes '(rustic-mode . rust-1))
(add-to-list 'purpose-user-mode-purposes '(rustic-compilation-mode . rust-3))
(require 'window-purpose-x)
(purpose-compile-user-configuration)
(purpose-mode)

And set the following purposes for those three windows (via purpose-set-window-purpose)

  1. rust-1
  2. misc
  3. rust-3

Now, a rustic-cargo-build will open the *rustic-compilation* buffer in window 3. So far so good.

Let's say that I switch to window 3, read the output, decide I'm done with it, and close the buffer. Since I generally only have one rustic-compilation buffer at a time, there are no remaining buffers with the purpose rust-3: emacs seems to put some random other buffer there. Whatever, that's fine.

Unfortunately issuing another rustic-cargo-build will display another fourth/popup window again, presumably because closing the last buffer with purpose rust-3 earlier removed the rust-3 purpose from window 3. Is it possible to prevent this from happening?

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

1 participant