Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

This commit is contained in:
Carsten Dominik 2010-11-24 02:14:29 +01:00
commit 125edaf6ae
6 changed files with 31 additions and 19 deletions

View file

@ -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."

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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
;;; test-ob ends here