summaryrefslogtreecommitdiff
path: root/lisp/ob-sql.el
diff options
context:
space:
mode:
authorSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:31 +0200
committerSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:31 +0200
commit52fbfeb04b10aa78f24f339a352fe1161c0b37e4 (patch)
treea3b147a3a2e4bb39c4ae36c0f442c6137ae506e2 /lisp/ob-sql.el
parent40ce6b75e6245659a3a14622356e32e7dd1125dd (diff)
Imported Upstream version 8.2.4
Diffstat (limited to 'lisp/ob-sql.el')
-rw-r--r--lisp/ob-sql.el24
1 files changed, 11 insertions, 13 deletions
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 658a54f..d17dd8a 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -186,19 +186,17 @@ This function is called by `org-babel-execute-src-block'."
(lambda (pair)
(setq body
(replace-regexp-in-string
- (format "\$%s" (car pair))
- ((lambda (val)
- (if (listp val)
- ((lambda (data-file)
- (with-temp-file data-file
- (insert (orgtbl-to-csv
- val '(:fmt (lambda (el) (if (stringp el)
- el
- (format "%S" el)))))))
- data-file)
- (org-babel-temp-file "sql-data-"))
- (if (stringp val) val (format "%S" val))))
- (cdr pair))
+ (format "\$%s" (car pair)) ;FIXME: "\$" == "$"!
+ (let ((val (cdr pair)))
+ (if (listp val)
+ (let ((data-file (org-babel-temp-file "sql-data-")))
+ (with-temp-file data-file
+ (insert (orgtbl-to-csv
+ val '(:fmt (lambda (el) (if (stringp el)
+ el
+ (format "%S" el)))))))
+ data-file)
+ (if (stringp val) val (format "%S" val))))
body)))
vars)
body)