On 25/03/2024 19:49, Max Nikulin wrote:
(defun org-ensure-tmp-dir (dir-symbol prefix) (let ((dir (symbol-value dir-symbol))) ;; Temporary directory has not been cleaned. (or (and dir (file-directory-p dir) dir)
`if' should be used instead of `or' here.
(setf (symbol-value dir-symbol) (make-temp-file (or prefix "orgtmp-") 'dir))))) (defvar org-tex-tmpdir nil) Usage example: (org-ensure-tmp-dir 'org-tex-tmpdir "orgtex-")
I do not like that the function may be called with different `temporary-file-directory' and I can not figure out how to adjust API to handle such case. On the other hand I am unsure if it is a realistic case when this function is called with alternating `temporary-file-directory'.