diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:35 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:35 +0200 |
commit | 361fd4da7cfa870165cb1ec175cdbea55ca40e7e (patch) | |
tree | a36bfd91d9e14c354b6eaebb20f5d5d64ec438db /lisp/ob-tangle.el | |
parent | 77ddd382df838e38504b822e729250b2a6dd9b63 (diff) |
Imported Upstream version 8.2.7a
Diffstat (limited to 'lisp/ob-tangle.el')
-rw-r--r-- | lisp/ob-tangle.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 37b2d92..3a43b42 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -225,13 +225,14 @@ used to limit the exported source code blocks by language." (concat base-name "." ext) base-name)))) (when file-name ;; Possibly create the parent directories for file. - (when (let ((m (funcall get-spec :mkdirp))) - (and m (not (string= m "no")))) - (make-directory (file-name-directory file-name) 'parents)) + (let ((m (funcall get-spec :mkdirp)) + (fnd (file-name-directory file-name))) + (and m fnd (not (string= m "no")) + (make-directory fnd 'parents))) ;; delete any old versions of file - (when (and (file-exists-p file-name) - (not (member file-name (mapcar #'car path-collector)))) - (delete-file file-name)) + (and (file-exists-p file-name) + (not (member file-name (mapcar #'car path-collector))) + (delete-file file-name)) ;; drop source-block to file (with-temp-buffer (when (fboundp lang-f) (ignore-errors (funcall lang-f))) |