From 4f113630f89fb712f3515ec8ee16bb361e7a5893 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Tue, 25 May 2010 20:20:13 -0600 Subject: [PATCH] org-babel-exp: no longer throws errors on empty bodies --- contrib/babel/lisp/org-babel-exp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/babel/lisp/org-babel-exp.el b/contrib/babel/lisp/org-babel-exp.el index 2179234c9..3079e3ad8 100644 --- a/contrib/babel/lisp/org-babel-exp.el +++ b/contrib/babel/lisp/org-babel-exp.el @@ -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)" -- 2.11.4.GIT