removing org-babel-temp-directory until some issues are resolved

This commit is contained in:
Eric Schulte 2010-09-13 11:55:38 -04:00
parent bbac53d7fe
commit c19a04ec9f
1 changed files with 28 additions and 27 deletions

View File

@ -1736,13 +1736,13 @@ the remote connection."
localname)) localname))
file)) file))
(defvar org-babel-temporary-directory ;; (defvar org-babel-temporary-directory
(or (and (boundp 'org-babel-temporary-directory) ;; (or (and (boundp 'org-babel-temporary-directory)
org-babel-temporary-directory) ;; org-babel-temporary-directory)
(make-temp-file "babel-" t)) ;; (make-temp-file "babel-" t))
"Directory to hold temporary files created to execute code blocks. ;; "Directory to hold temporary files created to execute code blocks.
Used by `org-babel-temp-file'. This directory will be removed on ;; Used by `org-babel-temp-file'. This directory will be removed on
Emacs shutdown.") ;; Emacs shutdown.")
(defun org-babel-temp-file (prefix &optional suffix) (defun org-babel-temp-file (prefix &optional suffix)
"Create a temporary file in the `org-babel-temporary-directory'. "Create a temporary file in the `org-babel-temporary-directory'.
@ -1755,28 +1755,29 @@ of `org-babel-temporary-directory'."
(expand-file-name (expand-file-name
prefix temporary-file-directory) prefix temporary-file-directory)
nil suffix)) nil suffix))
(let ((temporary-file-directory (expand-file-name ;; (let ((temporary-file-directory (expand-file-name
org-babel-temporary-directory ;; org-babel-temporary-directory
temporary-file-directory))) ;; temporary-file-directory)))
(make-temp-file prefix nil suffix)))) ;; (make-temp-file prefix nil suffix))
(make-temp-file prefix nil suffix)))
(defun org-babel-remove-temporary-directory () ;; (defun org-babel-remove-temporary-directory ()
"Remove `org-babel-temporary-directory' on Emacs shutdown." ;; "Remove `org-babel-temporary-directory' on Emacs shutdown."
(when (boundp 'org-babel-temporary-directory) ;; (when (boundp 'org-babel-temporary-directory)
;; taken from `delete-directory' in files.el ;; ;; taken from `delete-directory' in files.el
(mapc (lambda (file) ;; (mapc (lambda (file)
;; This test is equivalent to ;; ;; This test is equivalent to
;; (and (file-directory-p fn) (not (file-symlink-p fn))) ;; ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
;; but more efficient ;; ;; but more efficient
(if (eq t (car (file-attributes file))) ;; (if (eq t (car (file-attributes file)))
(delete-directory file) ;; (delete-directory file)
(delete-file file))) ;; (delete-file file)))
;; We do not want to delete "." and "..". ;; ;; We do not want to delete "." and "..".
(directory-files org-babel-temporary-directory 'full ;; (directory-files org-babel-temporary-directory 'full
"^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")) ;; "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
(delete-directory org-babel-temporary-directory))) ;; (delete-directory org-babel-temporary-directory)))
(add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory) ;; (add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory)
(provide 'ob) (provide 'ob)