diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
commit | e32a45ed36d6000db4b39171149072d11b77af72 (patch) | |
tree | b5f4a7d43022c08c3298e82b3e9fc50f68be660f /lisp/ob-ocaml.el | |
parent | 7697fa4daf3ec84f85711a84035d8f0224afd4e3 (diff) |
Imported Upstream version 8.0.7
Diffstat (limited to 'lisp/ob-ocaml.el')
-rw-r--r-- | lisp/ob-ocaml.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/ob-ocaml.el b/lisp/ob-ocaml.el index d2bf366..6a83908 100644 --- a/lisp/ob-ocaml.el +++ b/lisp/ob-ocaml.el @@ -1,6 +1,6 @@ ;;; ob-ocaml.el --- org-babel functions for ocaml evaluation -;; Copyright (C) 2009-2012 Free Software Foundation, Inc. +;; Copyright (C) 2009-2013 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Keywords: literate programming, reproducible research @@ -36,11 +36,11 @@ ;;; Code: (require 'ob) -(require 'ob-comint) (require 'comint) (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) @@ -74,7 +74,11 @@ (progn (setq out t) nil)))) (mapcar #'org-babel-trim (reverse raw)))))))) (org-babel-reassemble-table - (org-babel-ocaml-parse-output (org-babel-trim clean)) + (let ((raw (org-babel-trim clean))) + (org-babel-result-cond (cdr (assoc :result-params params)) + ;; strip type information from output + (if (string-match "= \\(.+\\)$" raw) (match-string 1 raw) raw) + (org-babel-ocaml-parse-output raw))) (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name @@ -89,8 +93,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." |