Skip to content

Commit

Permalink
ob-core: Fix nil value of `org-babel-temporary-stable-directory'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yantar92 committed Jul 7, 2022
1 parent 7135982 commit bdf7afe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lisp/ob-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -3162,12 +3162,13 @@ Emacs shutdown."))
(or (and (boundp 'org-babel-temporary-stable-directory)
(file-exists-p org-babel-temporary-stable-directory)
org-babel-temporary-stable-directory)
(condition-case nil
(make-directory
(expand-file-name
"babel-stable"
(temporary-file-directory)))
(t nil)))
(let (dir)
(while (or (not dir) (file-exists-p dir))
(setq dir (expand-file-name
(format "babel-stable-%d" (random 1000))
(temporary-file-directory))))
(make-directory dir)
dir))
"Directory to hold temporary files created to execute code blocks.
Used by `org-babel-temp-file'. This directory will be removed on
Emacs shutdown."))
Expand Down

0 comments on commit bdf7afe

Please sign in to comment.