From 3b9c47419347091fb02d1935298c196ff1abcf5a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 24 Jul 2019 00:44:38 -0500 Subject: [PATCH] Fix: (org-ql-query) Don't byte-compile compiled functions --- org-ql.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org-ql.el b/org-ql.el index 8d23add..1fcd939 100644 --- a/org-ql.el +++ b/org-ql.el @@ -179,8 +179,13 @@ non-nil." (user-error "Can't open file: %s" it))))))) ((query preamble-re) (org-ql--query-preamble query)) (predicate (org-ql--query-predicate query)) - ;; FIXME: Don't try to byte-compile already-compiled functions. - (action (byte-compile action)) + (action (cl-etypecase action + (symbol (unless (functionp action) + (user-error "Action not a function: %s" action)) + action) + (function (byte-compile action)) + (list (byte-compile `(lambda (&rest _ignore) + ,action))))) ;; TODO: Figure out how to use or reimplement the org-scanner-tags feature. ;; (org-use-tag-inheritance t) ;; (org-trust-scanner-tags t)