diff --git a/contrib/babel/lisp/langs/org-babel-latex.el b/contrib/babel/lisp/langs/org-babel-latex.el index f32828d63..85ec2bc73 100644 --- a/contrib/babel/lisp/langs/org-babel-latex.el +++ b/contrib/babel/lisp/langs/org-babel-latex.el @@ -69,7 +69,7 @@ called by `org-babel-execute-src-block'." body out-file org-format-latex-options in-buffer)) ((string-match "\\.pdf$" out-file) (org-babel-latex-body-to-tex-file tex-file body pdfheight pdfwidth) - (delete-file out-file) + (when (file-exists-p out-file) (delete-file out-file)) (rename-file (org-babel-latex-tex-to-pdf tex-file) out-file)) ((string-match "\\.\\([^\\.]+\\)$" out-file) (error diff --git a/contrib/babel/lisp/org-babel-exp.el b/contrib/babel/lisp/org-babel-exp.el index 639db35d3..0a37a6284 100644 --- a/contrib/babel/lisp/org-babel-exp.el +++ b/contrib/babel/lisp/org-babel-exp.el @@ -138,11 +138,11 @@ options are taken from `org-babel-default-header-args'." ('block (let ((str (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body (if (string-match "\n$" body) "" "\n")))) - (add-text-properties 0 (length str) - (list 'org-caption - (format "%s(%s)" - name (mapconcat #'identity args ", "))) - str) str)) + (when name (add-text-properties 0 (length str) + (list 'org-caption + (format "%s(%s)" + name (mapconcat #'identity args ", "))) + str) str))) ('lob (let ((call-line (and (string-match "results=" (car args)) (substring (car args) (match-end 0)))))