emacs-jupyter / jupyter

An interface to communicate with Jupyter kernels.
GNU General Public License v3.0
935 stars 92 forks source link

jupyter-repl-associate-buffer window #270

Open colormotor opened 4 years ago

colormotor commented 4 years ago

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

dangom commented 4 years ago

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

colormotor commented 4 years ago

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?

dangom commented 4 years ago

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

pmercatoris commented 4 years ago

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.

colormotor commented 4 years ago

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

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