org-babel-exp: no longer throws errors on empty bodies

This commit is contained in:
Eric Schulte 2010-05-25 20:20:13 -06:00
parent ceeb4681ef
commit 4f113630f8
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ options are taken from `org-babel-default-header-args'."
('inline (format "=%s=" body))
('block
(let ((str (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body
(if (string-match "\n$" body) "" "\n"))))
(if (and body (string-match "\n$" body))
"" "\n"))))
(when name (add-text-properties 0 (length str)
(list 'org-caption
(format "%s(%s)"