mirror of
https://github.com/org-roam/org-roam
synced 2025-08-03 12:27:23 -05:00
(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:
@ -219,14 +219,13 @@ into a digraph."
|
|||||||
|
|
||||||
(defun org-roam-graph--build (&optional node-query)
|
(defun org-roam-graph--build (&optional node-query)
|
||||||
"Generate a graph showing the relations between nodes in NODE-QUERY."
|
"Generate a graph showing the relations between nodes in NODE-QUERY."
|
||||||
(let* ((name org-roam-graph-executable)
|
(let ((name org-roam-graph-executable))
|
||||||
(exec (ignore-errors (executable-find name))))
|
(unless (stringp name)
|
||||||
(unless exec
|
(user-error "`org-roam-graph-executable' is not a string"))
|
||||||
(user-error (concat "Cannot find executable "
|
(unless (executable-find org-roam-graph-executable)
|
||||||
(when name
|
(user-error (concat "Cannot find executable \"%s\" to generate the graph. "
|
||||||
(format "\"%s\" " name))
|
"Please adjust `org-roam-graph-executable'")
|
||||||
"to generate the graph. "
|
name))
|
||||||
"Please adjust `org-roam-graph-executable'")))
|
|
||||||
(let* ((node-query (or node-query
|
(let* ((node-query (or node-query
|
||||||
`[:select [file titles]
|
`[:select [file titles]
|
||||||
:from titles
|
:from titles
|
||||||
@ -234,7 +233,7 @@ into a digraph."
|
|||||||
(graph (org-roam-graph--dot node-query))
|
(graph (org-roam-graph--dot node-query))
|
||||||
(temp-dot (make-temp-file "graph." nil ".dot" graph))
|
(temp-dot (make-temp-file "graph." nil ".dot" graph))
|
||||||
(temp-graph (make-temp-file "graph." nil ".svg")))
|
(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)))
|
temp-graph)))
|
||||||
|
|
||||||
(defun org-roam-graph--open (file)
|
(defun org-roam-graph--open (file)
|
||||||
|
Reference in New Issue
Block a user