diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-11-24 02:14:29 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-11-24 02:14:29 +0100 |
commit | 125edaf6ae26a2de03c16ed6bed4ad65a5fdccf1 (patch) | |
tree | ff8c9b5509ff10c791052c0eb0c38dedd9ebaa29 | |
parent | fb008fdd8879acff27b552bf01c1af1b3a262a04 (diff) | |
parent | 6e3f1e11752427ed6671827f47a4125f6209be96 (diff) | |
download | org-mode-125edaf6ae26a2de03c16ed6bed4ad65a5fdccf1.tar.gz |
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
-rw-r--r-- | lisp/ob-sh.el | 13 | ||||
-rw-r--r-- | lisp/ob.el | 2 | ||||
-rw-r--r-- | lisp/org-macs.el | 2 | ||||
-rw-r--r-- | testing/examples/babel.org | 11 | ||||
-rw-r--r-- | testing/lisp/test-ob-lob.el | 7 | ||||
-rw-r--r-- | testing/lisp/test-ob.el | 15 |
6 files changed, 31 insertions, 19 deletions
diff --git a/lisp/ob-sh.el b/lisp/ob-sh.el index e863864..ebfb870 100644 --- a/lisp/ob-sh.el +++ b/lisp/ob-sh.el @@ -100,7 +100,7 @@ var of the same value." (if (listp el) (mapcar #'deep-string el) (org-babel-sh-var-to-sh el sep)))) - (format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)" + (format "$(cat <<'BABEL_TABLE'\n%s\nBABEL_TABLE\n)" (orgtbl-to-generic (deep-string (if (listp (car var)) var (list var))) (list :sep (or sep "\t"))))) @@ -114,16 +114,7 @@ var of the same value." "Convert RESULTS to an appropriate elisp value. If the results look like a table, then convert them into an Emacs-lisp table, otherwise return the results as a string." - (org-babel-read - (if (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-sh-initiate-session (&optional session params) "Initiate a session named SESSION according to PARAMS." @@ -913,7 +913,7 @@ may be specified at the top of the current buffer." arg) (cons (intern (match-string 1 arg)) (org-babel-read (org-babel-chomp (match-string 2 arg)))) - (cons (intern arg) nil))) + (cons (intern (org-babel-chomp arg)) nil))) (let ((balance 0) (partial nil) (lst nil) (last 0)) (mapc (lambda (ch) ; split on [] balanced instances of [ \t]: (setq balance (+ balance diff --git a/lisp/org-macs.el b/lisp/org-macs.el index c63b1b0..5ea2d43 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -49,7 +49,7 @@ (with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1 (interactive-p)))) -(if (or (<= emacs-major-version 23) +(if (or (< emacs-major-version 23) (and (<= emacs-major-version 23) (< emacs-minor-version 2))) (defmacro with-silent-modifications diff --git a/testing/examples/babel.org b/testing/examples/babel.org index c934152..6ca7c2f 100644 --- a/testing/examples/babel.org +++ b/testing/examples/babel.org @@ -143,10 +143,19 @@ * executing an lob call line :PROPERTIES: :results: silent + :ID: fab7e291-fde6-45fc-bf6e-a485b8bca2f0 :END: -69fbe856-ca9c-4f20-9146-826d2f488c1d #+call: echo(input="testing") #+call: echo(input="testing") :results vector #+call: echo[:var input="testing"]() #+call: echo[:var input="testing"]() :results vector + +* parsing header arguments + :PROPERTIES: + :ID: 7eb0dc6e-1c53-4275-88b3-b22f3113b9c3 + :END: + +#+begin_src example-lang :session :results output :var num=9 + the body +#+end_src diff --git a/testing/lisp/test-ob-lob.el b/testing/lisp/test-ob-lob.el index 5d3dddd..92ba967 100644 --- a/testing/lisp/test-ob-lob.el +++ b/testing/lisp/test-ob-lob.el @@ -28,11 +28,10 @@ (ert-deftest test-ob-lob/call-with-header-arguments () "Test the evaluation of a library of babel #+call: line." - (org-test-at-marker - (expand-file-name "babel.org" org-test-example-dir) - "69fbe856-ca9c-4f20-9146-826d2f488c1d" + (org-test-at-id "fab7e291-fde6-45fc-bf6e-a485b8bca2f0" (move-beginning-of-line 1) - (forward-line 1) + (forward-line 6) + (message (buffer-substring (point-at-bol) (point-at-eol))) (should (string= "testing" (org-babel-lob-execute (org-babel-lob-get-info)))) (forward-line 1) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index f937c99..fde9887 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -70,6 +70,19 @@ (should (string= "7374bf4f8a18dfcb6f365f93d15f1a0ef42db745" (org-babel-sha1-hash))))) +(ert-deftest test-org-babel/parse-header-args () + (org-test-at-id "7eb0dc6e-1c53-4275-88b3-b22f3113b9c3" + (org-babel-next-src-block) + (let* ((info (org-babel-get-src-block-info)) + (params (nth 2 info))) + (message "%S" params) + (should (equal "example-lang" (nth 0 info))) + (should (string= "the body" (org-babel-trim (nth 1 info)))) + (should-not (member '(:session\ \ \ \ ) params)) + (should (equal '(:session) (assoc :session params))) + (should (equal '(:result-type . output) (assoc :result-type params))) + (should (equal '(num . 9) (cdr (assoc :var params))))))) + (provide 'test-ob) -;;; test-ob ends here
\ No newline at end of file +;;; test-ob ends here |