Skip to content

Commit bdf7afe

Browse files
committed
ob-core: Fix nil value of `org-babel-temporary-stable-directory'
* lisp/ob-core.el: Make sure that `org-babel-temporary-stable-directory' is set to non-nil non-existent directory. Non-existent directory is required to avoid clashes when multiple Emacs processes are running. Fixes https://yhetil.org/emacs-devel/87sfnfhm6v.fsf@yandex.com
1 parent 7135982 commit bdf7afe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lisp/ob-core.el

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3162,12 +3162,13 @@ Emacs shutdown."))
31623162
(or (and (boundp 'org-babel-temporary-stable-directory)
31633163
(file-exists-p org-babel-temporary-stable-directory)
31643164
org-babel-temporary-stable-directory)
3165-
(condition-case nil
3166-
(make-directory
3167-
(expand-file-name
3168-
"babel-stable"
3169-
(temporary-file-directory)))
3170-
(t nil)))
3165+
(let (dir)
3166+
(while (or (not dir) (file-exists-p dir))
3167+
(setq dir (expand-file-name
3168+
(format "babel-stable-%d" (random 1000))
3169+
(temporary-file-directory))))
3170+
(make-directory dir)
3171+
dir))
31713172
"Directory to hold temporary files created to execute code blocks.
31723173
Used by `org-babel-temp-file'. This directory will be removed on
31733174
Emacs shutdown."))

0 commit comments

Comments
 (0)