Browse Source

check that tuareg-run-caml is defined before use

* lisp/ob-ocaml.el (org-babel-prep-session:ocaml): Check that
  tuareg-run-caml is defined before use.
  (tuareg-run-ocaml): Declared for compiler.
Eric Schulte 5 years ago
parent
commit
7b62ae77b3
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/ob-ocaml.el

+ 4 - 2
lisp/ob-ocaml.el

@@ -40,6 +40,7 @@
 (eval-when-compile (require 'cl))
 
 (declare-function tuareg-run-caml "ext:tuareg" ())
+(declare-function tuareg-run-ocaml "ext:tuareg" ())
 (declare-function tuareg-interactive-send-input "ext:tuareg" ())
 
 (defvar org-babel-tangle-lang-exts)
@@ -88,8 +89,9 @@
                                                  (stringp session))
                                             session
                                           tuareg-interactive-buffer-name)))
-    (save-window-excursion (tuareg-run-caml)
-                           (get-buffer tuareg-interactive-buffer-name))))
+    (save-window-excursion
+      (if (fboundp 'tuareg-run-caml) (tuareg-run-caml) (tuareg-run-ocaml))
+      (get-buffer tuareg-interactive-buffer-name))))
 
 (defun org-babel-variable-assignments:ocaml (params)
   "Return list of ocaml statements assigning the block's variables."