Skip to content

Commit

Permalink
Invalid SORT-FN passed torows errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-shariff committed Jul 21, 2024
1 parent f628fef commit 1537504
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions org-roam-ql.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ SOURCE-OR-QUERY can be one of the following:
SORT-FN can be a function that takes two org-roam-nodes, and
compatible with `seq-sort'. Or it can be any regsitered sort
functions."
functions with `org-roam-ql-register-sort-fn'."
(--> (cond
;; TODO: think of a better way to display the nodes in the query
;; without showing it all. Perhaps use only ids?
Expand Down Expand Up @@ -114,7 +114,10 @@ functions."
(t (user-error "Invalid source-or-query")))
(if-let ((-sort-fn (when sort-fn
(or (and (functionp sort-fn) sort-fn)
(gethash sort-fn org-roam-ql--sort-functions) sort-fn))))
(gethash sort-fn org-roam-ql--sort-functions)
(user-error (concat "SORT-FN is not a function registered"
"as a sort-function"
"(see `org-roam-ql-register-sort-fn')"))))))
(seq-sort -sort-fn it)
it)))

Expand Down

0 comments on commit 1537504

Please sign in to comment.