Skip to content

Commit 64aaf18

Browse files
committed
Handle defpred-alias with arguments
1 parent 0b395c3 commit 64aaf18

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

org-ql.el

+9-6
Original file line numberDiff line numberDiff line change
@@ -1166,19 +1166,22 @@ More optimal definition would be:
11661166
NAME may be a symbol or a list of symbols: if a list, the first
11671167
is used as NAME and the rest are aliases.
11681168
1169-
ARGS is a `cl-defun'-style argument list. DOCSTRING is the
1170-
function's docstring.
1169+
ARGS is an argument list. DOCSTRING is the function's docstring.
11711170
11721171
QUERY is a valid `org-ql' query."
11731172
(declare (debug ([&or symbolp listp] listp stringp
11741173
&rest (sexp query)))
11751174
(indent defun))
11761175
`(org-ql-defpred ,name ,args
11771176
,docstring
1178-
:normalizers ((`(,predicate-names)
1179-
`,query))
1180-
:body
1181-
,query))
1177+
:normalizers ((`(,predicate-names . ,arg-values)
1178+
(cl-progv ',args arg-values
1179+
(-tree-map
1180+
(lambda (el)
1181+
(if (cl-member el ',args)
1182+
(symbol-value el)
1183+
el))
1184+
',query))))))
11821185

11831186
(defmacro org-ql--normalize-from-to-on (&rest body)
11841187
"For internal use.

0 commit comments

Comments
 (0)