Browse Source

Babel ocaml: fix bug where the first exported result would end up in the ocaml
buffer

* lisp/ob-ocaml.el (org-babel-prep-session:ocaml): use `save-window-excursion'
around the code starting the tuareg process.

Alan Schmitt 12 years ago
parent
commit
706a546fcf
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/ob-ocaml.el

+ 3 - 3
lisp/ob-ocaml.el

@@ -103,9 +103,9 @@
                                                  (stringp session))
                                             session
                                           tuareg-interactive-buffer-name)))
-    (if (fboundp 'tuareg-run-process-if-needed)
-        (tuareg-run-process-if-needed org-babel-ocaml-command)
-      (tuareg-run-caml))
+    (save-window-excursion (if (fboundp 'tuareg-run-process-if-needed)
+	 (tuareg-run-process-if-needed org-babel-ocaml-command)
+       (tuareg-run-caml)))
     (get-buffer tuareg-interactive-buffer-name)))
 
 (defun org-babel-variable-assignments:ocaml (params)