From e32a45ed36d6000db4b39171149072d11b77af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Sun, 13 Jul 2014 13:35:27 +0200 Subject: Imported Upstream version 8.0.7 --- lisp/ob-haskell.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'lisp/ob-haskell.el') 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) -- cgit v1.2.3