Explorar o código

babel: check pdf file existence before deleting

Dan Davison %!s(int64=15) %!d(string=hai) anos
pai
achega
1e96482389
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      contrib/babel/lisp/langs/org-babel-latex.el

+ 1 - 1
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