diff options
author | Bastien Guerry <bzg@altern.org> | 2011-07-16 18:40:36 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-07-16 18:40:36 +0200 |
commit | b93da58e1f687fb4e274cdfd43e8b797ff9d4ebf (patch) | |
tree | ca22a124abfce0bec828afd68850bb2beaf9a2e5 | |
parent | 4c714198b4140b62ca679b358824113f7311e3c9 (diff) | |
download | org-mode-b93da58e1f687fb4e274cdfd43e8b797ff9d4ebf.tar.gz |
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.
-rw-r--r-- | lisp/ob.el | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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." |