From f6d7514159008ae65a224071cb16d6fa2ac36e8c Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Wed, 12 Apr 2023 12:51:05 +0200 Subject: [PATCH] Handle the case when org-use-property-inheritance is a list of strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When org-use-property-inheritance is a list, then the query (property "FOO" "BAR") would bail out with: org-ql--byte-compile-warning: Invalid Org QL query: "Invalid Org QL query: \"‘\\\"BLAH\\\"’ is a malformed function\", :warning", :error (property "FOO") would still work though. So, if org-use-property-inheritance is a list, cast it to the (default) boolean value for this variable: nil. Use 'selective' inheritance when org-use-property-inheritance is a list This symbol is mentioned in the org-entry-get documentation. --- org-ql.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/org-ql.el b/org-ql.el index e0fea0c..8a00485 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1823,14 +1823,10 @@ interpreted as nil or non-nil)." ;; otherwise would require ugly special-casing in the parsing). (when (keywordp property) (setf property (substring (symbol-name property) 1))) - `(property ,property ,value - :inherit ,(if (plist-member plist :inherit) - (plist-get plist :inherit) - ;; TODO: Add tests for these cases. - (pcase org-use-property-inheritance - (`nil nil) (`t t) - ((pred stringp) org-use-property-inheritance) - ((pred listp) `(quote ,org-use-property-inheritance))))))) + (list 'property property value + :inherit (cond ((plist-member plist :inherit) (plist-get plist :inherit)) + ((listp org-use-property-inheritance) ''selective) + (t org-use-property-inheritance))))) ;; MAYBE: Should case folding be disabled for properties? What about values? ;; MAYBE: Support (property) without args.