summaryrefslogtreecommitdiff
path: root/lisp/ob-haskell.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ob-haskell.el')
-rw-r--r--lisp/ob-haskell.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el
index 1588f99..6f0fbcd 100644
--- a/lisp/ob-haskell.el
+++ b/lisp/ob-haskell.el
@@ -1,6 +1,6 @@
;;; ob-haskell.el --- org-babel functions for haskell 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
@@ -40,7 +40,6 @@
;;; Code:
(require 'ob)
-(require 'ob-comint)
(require 'comint)
(eval-when-compile (require 'cl))
@@ -79,11 +78,12 @@
(cdr (member org-babel-haskell-eoe
(reverse (mapcar #'org-babel-trim raw)))))))
(org-babel-reassemble-table
- (cond
- ((equal result-type 'output)
- (mapconcat #'identity (reverse (cdr results)) "\n"))
- ((equal result-type 'value)
- (org-babel-haskell-table-or-string (car results))))
+ ((lambda (result)
+ (org-babel-result-cond (cdr (assoc :result-params params))
+ result (org-babel-haskell-table-or-string result)))
+ (case result-type
+ ('output (mapconcat #'identity (reverse (cdr results)) "\n"))
+ ('value (car results))))
(org-babel-pick-name (cdr (assoc :colname-names params))
(cdr (assoc :colname-names params)))
(org-babel-pick-name (cdr (assoc :rowname-names params))
@@ -147,6 +147,9 @@ specifying a variable of the same value."
(format "%S" var)))
(defvar org-src-preserve-indentation)
+(declare-function org-export-to-file "ox"
+ (backend file
+ &optional subtreep visible-only body-only ext-plist))
(defun org-babel-haskell-export-to-lhs (&optional arg)
"Export to a .lhs file with all haskell code blocks escaped.
When called with a prefix argument the resulting
@@ -190,7 +193,11 @@ constructs (header arguments, no-web syntax etc...) are ignored."
(indent-code-rigidly (match-beginning 0) (match-end 0) indentation)))
(save-excursion
;; export to latex w/org and save as .lhs
- (find-file tmp-org-file) (funcall 'org-export-as-latex nil)
+ (require 'ox-latex)
+ (find-file tmp-org-file)
+ ;; Ensure we do not clutter kill ring with incomplete results.
+ (let (org-export-copy-to-kill-ring)
+ (org-export-to-file 'latex tmp-tex-file))
(kill-buffer nil)
(delete-file tmp-org-file)
(find-file tmp-tex-file)