From 27609264a5843b02e17def0c04c713e6992311c8 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 23 Nov 2020 04:21:10 -0600 Subject: [PATCH] Tidy: (org-ql--defpred) Somehow this old macro snuck back in...maybe in a merge gone bad? --- org-ql.el | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/org-ql.el b/org-ql.el index 499e0b1..2769c4c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -159,33 +159,6 @@ See Info node `(org-ql)Queries'." ;;;; Macros -(cl-defmacro org-ql--defpred (name args docstring &rest body) - "Define an `org-ql' selector predicate named `org-ql--predicate-NAME'. -NAME may be a symbol or a list of symbols: if a list, the first -is used as the name and the rest are aliases. ARGS is a -`cl-defun'-style argument list. DOCSTRING is the function's -docstring. BODY is the body of the predicate. - -Predicates will be called with point on the beginning of an Org -heading and should return non-nil if the heading's entry is a -match." - (declare (debug ([&or symbolp listp] listp stringp def-body)) - (indent defun)) - (let* ((aliases (when (listp name) - (cdr name))) - (name (cl-etypecase name - (list (car name)) - (atom name))) - (fn-name (intern (concat "org-ql--predicate-" (symbol-name name)))) - (pred-name (intern (symbol-name name)))) - `(progn - (cl-eval-when (compile load eval) - ;; When compiling, the predicate must be added to `org-ql-predicates' before `org-ql--def-plain-query-fn' - ;; is called to define `org-ql--plain-query'. Otherwise, `org-ql--plain-query' seems to work properly - ;; when interpreted but not always when the file is byte-compiled. - (push (list :name ',pred-name :aliases ',aliases :fn ',fn-name :docstring ,docstring :args ',args) org-ql-predicates)) - (cl-defun ,fn-name ,args ,docstring ,@body)))) - ;;;###autoload (cl-defmacro org-ql (buffers-or-files query &key sort narrow action) "Expands into a call to `org-ql-select' with the same arguments.