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

C-c C-z #633

Open
7stud opened this issue Apr 4, 2024 · 3 comments
Open

C-c C-z #633

7stud opened this issue Apr 4, 2024 · 3 comments

Comments

@7stud
Copy link

7stud commented Apr 4, 2024

I just switched from slime to sly. One of the really useful things I only recently discovered in slime was C-c C-z. I typically have emacs setup with two "windows" on top of each other: one displaying a .lisp file and another window below that with the slime repl:

Screen Shot 2024-04-04 at 12 47 05 PM

As typically happens, some other buffer will replace the slime repl in the lower window, and before I discovered C-c C-z, I would switch to the lower window, C-x o, then change buffers with C-x b and type in: slime-r <Tab><Ret>, which was a complete pain! That whole process was replaced by merely typing C-c C-z in the upper window containing my .lisp file, which would open the buffer with the slime repl in the lower window and switch the cursor to the slime repl. Wow!

In sly, things work slightly different. If the sly repl is already open in the lower window, then typing C-c C-z in the upper window will switch to the lower window--similar to C-x o. However, if another buffer is open in the lower window, then C-c C-z will cause my .lisp file in the upper window to disappear and be replaced by the sly repl. I don't want that to happen! For me, the whole beauty of C-c C-z was opening the repl in the lower window and switching to that window--no matter what buffer was open in the lower window. Can I get that same behavior in sly?

@mdbergmann
Copy link
Contributor

I have a similar workflow, using C-c C-z to switch to the repl window.
However, I don't let any other buffer replace the repl buffer in that window, so that C-c C-z always works.

@7stud
Copy link
Author

7stud commented Apr 4, 2024

@mdbergmann

I have a similar workflow, using C-c C-z to switch to the repl window.
However, I don't let any other buffer replace the repl buffer in that window, so that C-c C-z always works.

A few weeks ago, I searched around for how to "pin" the repl to the window, but I couldn't find anything. How do you manage that? And, what happens to the various buffers that try to replace the repl?

@mdbergmann
Copy link
Contributor

mdbergmann commented Apr 4, 2024

Not sure. The only buffers that popup (for me) are sly-compilation, some Magit stuff, and manually triggered Embark or so.
All of them except sly-compilation are being closed via "q" because only used temporary. For sly-compilation I see that it is open as tab in another windows so that it doesn't popup on top of the repl.
Maybe you work differently and this doesn't apply to you.
But I'd guess it might be doable to bind your own function to C-cC-z that looks where the repl is, and brings it to front before making it the current buffer.
Did you check what does Slime do differently (in code) than Sly?

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

2 participants