(fix): make graph--build error on non-string (#580)
* (fix): make graph--build error on non-string * Replace let* with let * Fix wording
This commit is contained in:
parent
9bc80ff9f7
commit
c1bfa99ace
1 changed files with 8 additions and 9 deletions
|
@ -219,14 +219,13 @@ into a digraph."
|
|||
|
||||
(defun org-roam-graph--build (&optional node-query)
|
||||
"Generate a graph showing the relations between nodes in NODE-QUERY."
|
||||
(let* ((name org-roam-graph-executable)
|
||||
(exec (ignore-errors (executable-find name))))
|
||||
(unless exec
|
||||
(user-error (concat "Cannot find executable "
|
||||
(when name
|
||||
(format "\"%s\" " name))
|
||||
"to generate the graph. "
|
||||
"Please adjust `org-roam-graph-executable'")))
|
||||
(let ((name org-roam-graph-executable))
|
||||
(unless (stringp name)
|
||||
(user-error "`org-roam-graph-executable' is not a string"))
|
||||
(unless (executable-find org-roam-graph-executable)
|
||||
(user-error (concat "Cannot find executable \"%s\" to generate the graph. "
|
||||
"Please adjust `org-roam-graph-executable'")
|
||||
name))
|
||||
(let* ((node-query (or node-query
|
||||
`[:select [file titles]
|
||||
:from titles
|
||||
|
@ -234,7 +233,7 @@ into a digraph."
|
|||
(graph (org-roam-graph--dot node-query))
|
||||
(temp-dot (make-temp-file "graph." nil ".dot" graph))
|
||||
(temp-graph (make-temp-file "graph." nil ".svg")))
|
||||
(call-process exec nil 0 nil temp-dot "-Tsvg" "-o" temp-graph)
|
||||
(call-process name nil 0 nil temp-dot "-Tsvg" "-o" temp-graph)
|
||||
temp-graph)))
|
||||
|
||||
(defun org-roam-graph--open (file)
|
||||
|
|
Loading…
Reference in a new issue