]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-haskell.el
Spelling fixes.
[gnu-emacs] / lisp / org / ob-haskell.el
index 1ae8fba66b6933a701b934cbbf1af4086e01e439..236dbba28f1ee53124556b8cd58528ba7b32a5eb 100644 (file)
@@ -1,11 +1,11 @@
 ;;; ob-haskell.el --- org-babel functions for haskell evaluation
 
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;; Keywords: literate programming, reproducible research
 ;; Homepage: http://orgmode.org
-;; Version: 7.3
+;; Version: 7.7
 
 ;; This file is part of GNU Emacs.
 
@@ -29,7 +29,7 @@
 ;; they can be run, but haskell code can also be run through an
 ;; interactive interpreter.
 ;;
-;; For now lets only allow evaluation using the haskell interpreter.
+;; For now let's only allow evaluation using the haskell interpreter.
 
 ;;; Requirements:
 
@@ -51,6 +51,7 @@
 (declare-function inferior-haskell-load-file
                  "ext:inf-haskell" (&optional reload))
 
+(defvar org-babel-tangle-lang-exts)
 (add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))
 
 (defvar org-babel-default-header-args:haskell '())
@@ -79,7 +80,7 @@
                    (cdr (member org-babel-haskell-eoe
                                 (reverse (mapcar #'org-babel-trim raw)))))))
     (org-babel-reassemble-table
-     (cond 
+     (cond
       ((equal result-type 'output)
        (mapconcat #'identity (reverse (cdr results)) "\n"))
       ((equal result-type 'value)
@@ -136,16 +137,7 @@ then create one.  Return the initialized session."
   "Convert RESULTS to an Emacs-lisp table or string.
 If 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 results))
 
 (defun org-babel-haskell-var-to-haskell (var)
   "Convert an elisp value VAR into a haskell variable.
@@ -200,7 +192,7 @@ constructs (header arguments, no-web syntax etc...) are ignored."
     (save-excursion
       ;; export to latex w/org and save as .lhs
       (find-file tmp-org-file) (funcall 'org-export-as-latex nil)
-      (kill-buffer)
+      (kill-buffer nil)
       (delete-file tmp-org-file)
       (find-file tmp-tex-file)
       (goto-char (point-min)) (forward-line 2)
@@ -210,7 +202,7 @@ constructs (header arguments, no-web syntax etc...) are ignored."
         (replace-match (save-match-data (org-remove-indentation (match-string 0)))
                        t t))
       (setq contents (buffer-string))
-      (save-buffer) (kill-buffer))
+      (save-buffer) (kill-buffer nil))
     (delete-file tmp-tex-file)
     ;; save org exported latex to a .lhs file
     (with-temp-file lhs-file (insert contents))
@@ -221,6 +213,6 @@ constructs (header arguments, no-web syntax etc...) are ignored."
 
 (provide 'ob-haskell)
 
-;; arch-tag: b53f75f3-ba1a-4b05-82d9-a2a0d4e70804
+
 
 ;;; ob-haskell.el ends here