Cannot open a nrepl in anything but the left window in Emacs #181

Closed
lincoln-bergeson opened this Issue Dec 5, 2012 · 6 comments

Projects

None yet

3 participants

@lincoln-bergeson

I've recently started using Clojure. I'm on a Windows 7 machine, on Emacs Live learning how to use Overtone. I was directed here by the Overtone people when I posted this in their Google group:

When I'm running multiple buffers (used C-x 3 to 
get two vertical side-by-sides, and C-x C-f to open up two clojure 
files), and I want to change one to a repl with M-x nrepl, it always 
opens a repl in the left one, even when I deliberately put the focus 
on the right one. 

@kingtim
Member
kingtim commented Dec 6, 2012

Thank you for reporting this.
We were using switch-to-buffer-other-window when creating the repl buffer, but I just committed a change on master to use pop-to-buffer instead.

This should allow you to declare that you would like the repl buffer to be created in the same window using same-window-buffer-names or same-window-regexps.

For example, if I put the following in my ~/.emacs.d/init.el, it opens the repl buffer in the currently selected window.

(add-to-list 'same-window-buffer-names "*nrepl*")

Not sure if this exactly matches the behavior you want. There are lots of different ways of customizing it.
Check out
http://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window-Options.html#Choosing-Window-Options
for more info on the various ways you can customize which window is chosen.

Also check out
http://www.gnu.org/software/emacs/manual/html_node/elisp/Switching-Buffers.html
for more info on pop-to-buffer.

@kingtim
Member
kingtim commented Dec 11, 2012

Is this issue resolved for you?

@lincoln-bergeson

I'll check it out when I get home, sorry for the slow response.

@lincoln-bergeson

No, it still only opens in the left window. I am using Windows, so I can try this out on Ubuntu sometime, maybe it will work there.

@kingtim
Member
kingtim commented Dec 13, 2012

Did you set ?
(add-to-list 'same-window-buffer-names "*nrepl*")

@lincoln-bergeson

Yep. Doesn't fix it. I'll have a go at the link you mentioned.

EDIT: I don't understand any of it.

@bbatsov bbatsov closed this Jul 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment