ob.el: Bugfix about `nil' body variable when parsing block.

* ob.el (org-babel-strip-protective-commas): Return `nil'
instead of an error if no argument is given.
(org-babel-parse-src-block-match): Make sure body is defined
in the let construct.
This commit is contained in:
Bastien Guerry 2011-07-16 18:40:36 +02:00
parent 4c714198b4
commit b93da58e1f

View file

@ -960,8 +960,9 @@ may be specified in the current buffer."
(body (org-babel-clean-text-properties
(let* ((body (match-string 5))
(sub-length (- (length body) 1)))
(when (string= "\n" (substring body sub-length))
(substring body 0 sub-length)))))
(if (string= "\n" (substring body sub-length))
(substring body 0 sub-length)
body))))
(preserve-indentation (or org-src-preserve-indentation
(string-match "-i\\>" switches))))
(list lang
@ -1947,7 +1948,8 @@ block but are passed literally to the \"example-block\"."
(defun org-babel-strip-protective-commas (body)
"Strip protective commas from bodies of source blocks."
(replace-regexp-in-string "^,#" "#" body))
(when body
(replace-regexp-in-string "^,#" "#" body)))
(defun org-babel-script-escape (str &optional force)
"Safely convert tables into elisp lists."