From 8c7bc09f9bcbab28be01066f7eaf5588ba488ed3 Mon Sep 17 00:00:00 2001 From: N V <44036031+progfolio@users.noreply.github.com> Date: Tue, 14 Apr 2020 01:14:23 -0400 Subject: [PATCH] (fix): Use make-temp-file in org-roam-graph-build (#454) Create a new temporary file for each graph that is built. See: #453 --- org-roam-graph.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/org-roam-graph.el b/org-roam-graph.el index aaf4004..634209f 100644 --- a/org-roam-graph.el +++ b/org-roam-graph.el @@ -212,15 +212,15 @@ For building and showing the graph in a single step see `org-roam-graph-show'." (unless org-roam-graph-executable (user-error "Can't find %s executable. Please check if it is in your path" org-roam-graph-executable)) - (let* ((temp-dot (expand-file-name "graph.dot" temporary-file-directory)) - (temp-graph (expand-file-name "graph.svg" temporary-file-directory)) - (node-query (or node-query `[:select [file titles] - :from titles - ,@(org-roam-graph--expand-matcher 'file t)])) - (graph (org-roam-graph--build node-query))) - (with-temp-file temp-dot - (insert graph)) - (call-process org-roam-graph-executable nil 0 nil temp-dot "-Tsvg" "-o" temp-graph) + (let* ((node-query (or node-query + `[:select [file titles] + :from titles + ,@(org-roam-graph--expand-matcher 'file t)])) + (graph (org-roam-graph--build node-query)) + (temp-dot (make-temp-file "graph." nil ".dot" graph)) + (temp-graph (make-temp-file "graph." nil ".svg"))) + (call-process org-roam-graph-executable nil 0 nil + temp-dot "-Tsvg" "-o" temp-graph) temp-graph)) (defun org-roam-graph--open (file)