mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-29 20:35:02 +00:00
ob: ensure that org-babel-temporary-directory is bound before using
* lisp/ob.el (org-babel-temp-file): Ensure that org-babel-temporary-directory is bound before using. (org-babel-remove-temporary-directory): Safer error throwing.
This commit is contained in:
parent
d7008e6c79
commit
e72f207c3e
@ -1958,7 +1958,8 @@ of `org-babel-temporary-directory'."
|
||||
prefix temporary-file-directory)
|
||||
nil suffix))
|
||||
(let ((temporary-file-directory
|
||||
(or (and (file-exists-p org-babel-temporary-directory)
|
||||
(or (and (boundp 'org-babel-temporary-directory)
|
||||
(file-exists-p org-babel-temporary-directory)
|
||||
org-babel-temporary-directory)
|
||||
temporary-file-directory)))
|
||||
(make-temp-file prefix nil suffix))))
|
||||
@ -1983,7 +1984,9 @@ of `org-babel-temporary-directory'."
|
||||
(delete-directory org-babel-temporary-directory))
|
||||
(error
|
||||
(message "Failed to remove temporary Org-babel directory %s"
|
||||
org-babel-temporary-directory)))))
|
||||
(if (boundp 'org-babel-temporary-directory)
|
||||
org-babel-temporary-directory
|
||||
"[directory not defined]"))))))
|
||||
|
||||
(add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user