babel: check pdf file existence before deleting

This commit is contained in:
Dan Davison 2010-02-15 10:29:56 -07:00 committed by Eric Schulte
parent 747f425f00
commit 1e96482389
1 changed files with 1 additions and 1 deletions

View File

@ -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