Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Carsten Dominik 15 years ago
parent
commit
c9d7c2e966

+ 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

+ 5 - 5
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)))))