jupyter icon indicating copy to clipboard operation
jupyter copied to clipboard

jupyter-repl-associate-buffer window

Open colormotor opened this issue 4 years ago • 5 comments

Hello, I am not sure this is the right place to ask this, but I am trying to configure in which window the REPL is opened when calling jupyter-repl-associate-buffer. E.g. it currently always opens below the current one, but I would prefer it to be on the side, which is more convenient to view plot results. Is this something that can be configured locally for emacs-jupyter? Thanks in advance, Daniel

colormotor avatar Jul 10 '20 13:07 colormotor

See https://stackoverflow.com/questions/2081577/setting-emacs-to-split-buffers-side-by-side

dangom avatar Jul 13 '20 15:07 dangom

Thank you.

Unfortunately all the solutions in that thread seem to break other functionalities in other packages (I'm using doom-emacs). For the moment, I ended up adding a function that changes the layout as desired after the call to jupyter-repl-associate-buffer, based on code from the link above.

Wouldn't this be a useful option to have in emacs-jupyter?

colormotor avatar Jul 15 '20 10:07 colormotor

I would think emacs-jupyter as a package should not be conflicting with an user's window management.

dangom avatar Jul 15 '20 16:07 dangom

As I understand it, in doom-emacs, you can configure where the jupyter bufffer appear like this:

(set-popup-rule! "*jupyter-pager*" :side 'right :size .40 :select t :vslot 2 :ttl 3)
(set-popup-rule! "^\\*Org Src*" :side 'right :size .60 :select t :vslot 2 :ttl 3 :quit nil)
(set-popup-rule! "*jupyter-repl*" :side 'bottom :size .30 :vslot 2 :ttl nil :quit nil)
(set-popup-rule! "*jupyter-output*" :side 'bottom :size .30 :vslot 2)

They are set to be popup buffers, and all popups can be modified that way.

pmercatoris avatar Sep 23 '20 13:09 pmercatoris

Thanks @pmercatoris! That works great, using the following:

(set-popup-rule! "\*jupyter-repl...*" :side 'right :size .50 :vslot 2 :ttl nil :quit nil)

colormotor avatar Sep 23 '20 13:09 colormotor