Skip to content

Commit

Permalink
Create image cache directory with parents
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Coughlin committed Aug 9, 2019
1 parent 7aa4c92 commit 812baee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions calctex-test.el
Expand Up @@ -79,4 +79,13 @@
(assert-nth-overlay-equals 0 "resources/2a.png" 'png)
(assert-nth-overlay-equals 1 "resources/4a.png" 'png))))

(ert-deftest creates-parents-of-image-cache ()
(with-calc-test-harness
(lambda ()
(setq calctex-latex-image-directory "~/foo/bar/calctex")
(calctex-mode 1)
(execute-kbd-macro (kbd "' a <RET>"))
(execute-kbd-macro (kbd "2 <RET> *"))
(assert-nth-overlay-equals 0 "resources/2a.png" 'png))))

(provide 'calctex-test)
2 changes: 1 addition & 1 deletion calctex.el
Expand Up @@ -15,7 +15,7 @@ rendered image and the image type.
(lambda (src)
(if (file-exists-p calctex-latex-image-directory)
()
(make-directory calctex-latex-image-directory))
(make-directory calctex-latex-image-directory 'parents))
(let* ((fg (calctex-latex-color :foreground))
(bg (calctex-latex-color :background))
(hash (sha1 (prin1-to-string (list src fg bg))))
Expand Down

0 comments on commit 812baee

Please sign in to comment.