WIP
This commit is contained in:
parent
4575a66bed
commit
efae2229ed
1 changed files with 13 additions and 14 deletions
27
org-ql.el
27
org-ql.el
|
|
@ -410,20 +410,19 @@ It would be expanded to:
|
||||||
normalizers))
|
normalizers))
|
||||||
(preambles (cl-sublis (list (cons 'predicate-names (cons 'or (--map (list 'quote it) predicate-names))))
|
(preambles (cl-sublis (list (cons 'predicate-names (cons 'or (--map (list 'quote it) predicate-names))))
|
||||||
preambles)))
|
preambles)))
|
||||||
`(progn
|
`(cl-eval-when (compile load eval)
|
||||||
(cl-eval-when (compile load eval)
|
;; When compiling, the predicate must be added to `org-ql-predicates' before `org-ql--def-query-string-to-sexp-fn'
|
||||||
;; When compiling, the predicate must be added to `org-ql-predicates' before `org-ql--def-query-string-to-sexp-fn'
|
;; is called to define `org-ql--query-string-to-sexp'. Otherwise, `org-ql--query-string-to-sexp' seems to work properly
|
||||||
;; is called to define `org-ql--query-string-to-sexp'. Otherwise, `org-ql--query-string-to-sexp' seems to work properly
|
;; when interpreted but not always when the file is byte-compiled.
|
||||||
;; when interpreted but not always when the file is byte-compiled.
|
(setf (map-elt org-ql-predicates ',predicate-name)
|
||||||
(setf (map-elt org-ql-predicates ',predicate-name)
|
`(:name ,',name :aliases ,',aliases :fn ,',fn-name :docstring ,,docstring :args ,',args
|
||||||
`(:name ,',name :aliases ,',aliases :fn ,',fn-name :docstring ,,docstring :args ,',args
|
:normalizers ,',normalizers :preambles ,',preambles))
|
||||||
:normalizers ,',normalizers :preambles ,',preambles))
|
(unless org-ql-defpred-defer
|
||||||
(unless org-ql-defpred-defer
|
(org-ql--define-normalize-query (reverse org-ql-predicates))
|
||||||
(org-ql--define-normalize-query (reverse org-ql-predicates))
|
;; NOTE: Reversing is important!
|
||||||
;; NOTE: Reversing is important!
|
(org-ql--define-preamble-fn (reverse org-ql-predicates))
|
||||||
(org-ql--define-preamble-fn (reverse org-ql-predicates))
|
(org-ql--def-query-string-to-sexp-fn))
|
||||||
(org-ql--def-query-string-to-sexp-fn))
|
(cl-defun ,fn-name ,args ,docstring ,body))))
|
||||||
(cl-defun ,fn-name ,args ,docstring ,body)))))
|
|
||||||
|
|
||||||
;; TODO: Mark as obsolete/deprecated.
|
;; TODO: Mark as obsolete/deprecated.
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue