Ver código fonte

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

Eric Schulte 15 anos atrás
pai
commit
4f113630f8
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      contrib/babel/lisp/org-babel-exp.el

+ 2 - 1
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)"