When I use tuareg I like to have the toplevel in a separate frame, but as soon as I evaluate some code in the original frame the toplevel window reopen in that frame and that's not what I wan't.
More generally, I'd like to always popup new windows into frames as I'm using emacs daemon and a tiling window manager, I would like to replace all the window part of emacs by the frame.
There's a function to pop a window into a frame but I'd like to change the default behaviour.
How tuareg works :
I can open ocaml interpreter with C-c C-s
, if the interpreter isn't running it runs it in a new buffer called *ocaml toplevel* in a new window splitted horizontally. If it's already opened but the window at the bottom isn't, it open the window with the already opened *ocaml toplevel* in it.
It is binded to the function :
(defun tuareg-run-ocaml ()
"Run an OCaml toplevel process. I/O via buffer `*ocaml-toplevel*'."
(interactive)
(tuareg-run-process-if-needed)
(display-buffer tuareg-interactive-buffer-name))
I guess that it's display-buffer
whih I wan't to hack...
There's also evaluate region and evaluate buffer that evaluate some code in the tuareg buffer by the opened interpreter, and if it's not opened it opens it in a new window at the bottom like previously. In fact, it is quite similar to elisp evaluation but the result is in the *\ocaml toplevel* buffer and the window is always reopened when needed to show the result.
I don't show these functions because they call other tuareg functions so there would be a lot of functions in the post and I don't want to bother you with all that code. Jus tell me if you want more.
Thanks