summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-04-19 09:43:34 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-04-19 09:43:34 -0600
commit892b66f0625a33b294a793304f1a68983c52711d (patch)
tree765226bbdb2336edf8f3dedee663e41aea233cbf
parent1997e19bd514d81b5989cd3c0bfae87da474d460 (diff)
downloadorg-mode-892b66f0625a33b294a793304f1a68983c52711d.tar.gz
ob-ocaml: updated to use the new script-escape function
* lisp/ob-ocaml.el (org-babel-ocaml-read-list): Using `org-babel-script-escape'. (org-babel-ocaml-read-array): Using `org-babel-script-escape'.
-rw-r--r--lisp/ob-ocaml.el25
1 files changed, 6 insertions, 19 deletions
diff --git a/lisp/ob-ocaml.el b/lisp/ob-ocaml.el
index 4d366e7..1a21d15 100644
--- a/lisp/ob-ocaml.el
+++ b/lisp/ob-ocaml.el
@@ -125,30 +125,17 @@ OUTPUT is string output from an ocaml process."
"Convert RESULTS into an elisp table or string.
If the results look like a table, then convert them into an
Emacs-lisp table, otherwise return the results as a string."
- (org-babel-read
- (if (and (stringp results) (string-match "^\\[.+\\]$" results))
- (org-babel-read
- (replace-regexp-in-string
- "\\[" "(" (replace-regexp-in-string
- "\\]" ")" (replace-regexp-in-string
- "; " " " (replace-regexp-in-string
- "'" "\"" results)))))
- results)))
+ (org-babel-script-escape (replace-regexp-in-string ";" "," results)))
(defun org-babel-ocaml-read-array (results)
"Convert RESULTS into an elisp table or string.
If the results look like a table, then convert them into an
Emacs-lisp table, otherwise return the results as a string."
- (org-babel-read
- (if (and (stringp results) (string-match "^\\[.+\\]$" results))
- (org-babel-read
- (concat
- "'" (replace-regexp-in-string
- "\\[|" "(" (replace-regexp-in-string
- "|\\]" ")" (replace-regexp-in-string
- "; " " " (replace-regexp-in-string
- "'" "\"" results))))))
- results)))
+ (org-babel-script-escape
+ (replace-regexp-in-string
+ "\\[|" "[" (replace-regexp-in-string
+ "|\\]" "]" (replace-regexp-in-string
+ "; " "," results)))))
(provide 'ob-ocaml)