diff options
| author | Carsten Dominik | 2010-11-11 22:10:19 -0600 |
|---|---|---|
| committer | Carsten Dominik | 2010-11-11 22:10:19 -0600 |
| commit | afe98dfa700de5cf0493e8bf95b7d894e2734e47 (patch) | |
| tree | 92a812b353bb09c1286e8a44fb552de9f1af3384 /lisp/org/ob-sqlite.el | |
| parent | df26e1f58a7e484b7ed500ea48d0e1c49345ffbf (diff) | |
| download | emacs-afe98dfa700de5cf0493e8bf95b7d894e2734e47.tar.gz emacs-afe98dfa700de5cf0493e8bf95b7d894e2734e47.zip | |
Install org-mode version 7.3
Diffstat (limited to 'lisp/org/ob-sqlite.el')
| -rw-r--r-- | lisp/org/ob-sqlite.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el index 7d6930abd4b..c744e4334ec 100644 --- a/lisp/org/ob-sqlite.el +++ b/lisp/org/ob-sqlite.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Eric Schulte | 5 | ;; Author: Eric Schulte |
| 6 | ;; Keywords: literate programming, reproducible research | 6 | ;; Keywords: literate programming, reproducible research |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 7.01 | 8 | ;; Version: 7.3 |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -41,9 +41,10 @@ | |||
| 41 | '(db header echo bail csv column html line list separator nullvalue) | 41 | '(db header echo bail csv column html line list separator nullvalue) |
| 42 | "Sqlite specific header args.") | 42 | "Sqlite specific header args.") |
| 43 | 43 | ||
| 44 | (defun org-babel-expand-body:sqlite (body params &optional processed-params) | 44 | (defun org-babel-expand-body:sqlite (body params) |
| 45 | "Expand BODY according to the values of PARAMS." | ||
| 45 | (org-babel-sqlite-expand-vars | 46 | (org-babel-sqlite-expand-vars |
| 46 | body (or (nth 1 processed-params) (org-babel-ref-variables params)))) | 47 | body (mapcar #'cdr (org-babel-get-header params :var)))) |
| 47 | 48 | ||
| 48 | (defvar org-babel-sqlite3-command "sqlite3") | 49 | (defvar org-babel-sqlite3-command "sqlite3") |
| 49 | 50 | ||
| @@ -51,7 +52,7 @@ | |||
| 51 | "Execute a block of Sqlite code with Babel. | 52 | "Execute a block of Sqlite code with Babel. |
| 52 | This function is called by `org-babel-execute-src-block'." | 53 | This function is called by `org-babel-execute-src-block'." |
| 53 | (let ((result-params (split-string (or (cdr (assoc :results params)) ""))) | 54 | (let ((result-params (split-string (or (cdr (assoc :results params)) ""))) |
| 54 | (vars (org-babel-ref-variables params)) | 55 | (vars (org-babel-get-header params :var)) |
| 55 | (db (cdr (assoc :db params))) | 56 | (db (cdr (assoc :db params))) |
| 56 | (separator (cdr (assoc :separator params))) | 57 | (separator (cdr (assoc :separator params))) |
| 57 | (nullvalue (cdr (assoc :nullvalue params))) | 58 | (nullvalue (cdr (assoc :nullvalue params))) |
| @@ -70,10 +71,9 @@ This function is called by `org-babel-execute-src-block'." | |||
| 70 | (list | 71 | (list |
| 71 | (cons "body" ((lambda (sql-file) | 72 | (cons "body" ((lambda (sql-file) |
| 72 | (with-temp-file sql-file | 73 | (with-temp-file sql-file |
| 73 | (insert (org-babel-expand-body:sqlite | 74 | (insert (org-babel-expand-body:sqlite body params))) |
| 74 | body nil (list nil vars)))) | ||
| 75 | sql-file) | 75 | sql-file) |
| 76 | (make-temp-file "ob-sqlite-sql"))) | 76 | (org-babel-temp-file "sqlite-sql-"))) |
| 77 | (cons "cmd" org-babel-sqlite3-command) | 77 | (cons "cmd" org-babel-sqlite3-command) |
| 78 | (cons "header" (if headers-p "-header" "-noheader")) | 78 | (cons "header" (if headers-p "-header" "-noheader")) |
| 79 | (cons "separator" | 79 | (cons "separator" |
| @@ -117,8 +117,8 @@ This function is called by `org-babel-execute-src-block'." | |||
| 117 | el | 117 | el |
| 118 | (format "%S" el))))))) | 118 | (format "%S" el))))))) |
| 119 | data-file) | 119 | data-file) |
| 120 | (make-temp-file "ob-sqlite-data")) | 120 | (org-babel-temp-file "sqlite-data-")) |
| 121 | (format "%S" val))) | 121 | (if (stringp val) val (format "%S" val)))) |
| 122 | (cdr pair)) | 122 | (cdr pair)) |
| 123 | body))) | 123 | body))) |
| 124 | vars) | 124 | vars) |