From 3a5e4a1e11ffe5cef0b5db2c12ba46418c3a854f Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Sat, 31 Aug 2019 23:40:49 -0500 Subject: [PATCH] Fix: Add autoloads Fixes #36. Thanks to Akira Komamura (@akirak). --- README.org | 4 ++++ org-ql-agenda.el | 4 ++++ org-ql.el | 3 +++ 3 files changed, 11 insertions(+) diff --git a/README.org b/README.org index e52888c..9fd22da 100644 --- a/README.org +++ b/README.org @@ -442,6 +442,9 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. ** 0.2-pre +:PROPERTIES: +:ID: 67be09f9-e959-4333-9be2-93ad8f458fbe +:END: *Added* + Function ~org-ql-query~, like ~org-ql-select~ but with arguments named more like a SQL query. @@ -478,6 +481,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience + Don't search hidden/special buffers. + Properly accept arbitrary sort functions in =org-ql-select=, etc. (Fixes [[https://github.com/alphapapa/org-ql/issues/37][#37]]. Thanks to [[https://github.com/mz-pdm][Milan Zamazal]].) + Planning-line-related predicates searched too far into entries. ++ Add autoloads. (Fixes [[https://github.com/alphapapa/org-ql/pull/36/files#][#36]]. Thanks to [[https://github.com/akirak][Akira Komamura]].) *Compatibility* + Fixes for compatibility with Org 9.2. (Thanks to [[https://github.com/ataias][Ataias Pereira Reis]] and [[https://github.com/dakra][Daniel Kraus]].) diff --git a/org-ql-agenda.el b/org-ql-agenda.el index c26ba78..fa75f6d 100644 --- a/org-ql-agenda.el +++ b/org-ql-agenda.el @@ -120,6 +120,7 @@ e.g. `org-ql-search' as desired." ;; TODO: DRY these two macros. +;;;###autoload (cl-defmacro org-ql-agenda (&rest args) "Display an agenda-like buffer of entries in FILES that match QUERY. @@ -286,11 +287,13 @@ TITLE: An optional string displayed in the header." (customize-set-variable 'org-ql-views org-ql-views) (customize-mark-to-save 'org-ql-views))) +;;;###autoload (defun org-ql-view (&optional view) "Choose and display a view stored in `org-ql-views'." (interactive (list (completing-read "View: " (mapcar #'car org-ql-views)))) (call-interactively (alist-get view org-ql-views nil nil #'string=))) +;;;###autoload (cl-defun org-ql-view-recent-items (&key days type (files (org-agenda-files)) @@ -392,6 +395,7 @@ after the block." insert) (insert "\n"))) +;;;###autoload (defalias 'org-ql-block 'org-ql-agenda-block) (defun org-ql-agenda--header-line-format (buffers-files query &optional title) diff --git a/org-ql.el b/org-ql.el index 4b107ee..74bcc4a 100644 --- a/org-ql.el +++ b/org-ql.el @@ -120,6 +120,7 @@ match." (push (list :name ',pred-name :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. For convenience, arguments should be unquoted." @@ -135,6 +136,7 @@ For convenience, arguments should be unquoted." (define-hash-table-test 'org-ql-hash-test #'equal (lambda (args) (sxhash-equal (prin1-to-string args)))) +;;;###autoload (cl-defun org-ql-select (buffers-or-files query &key action narrow sort) "Return items matching QUERY in BUFFERS-OR-FILES. @@ -226,6 +228,7 @@ returns nil or non-nil." ((pred functionp) (sort items sort)) (_ (user-error "SORT must be either nil, one or a list of the defined sorting methods (see documentation), or a comparison function of two arguments"))))) +;;;###autoload (cl-defun org-ql-query (&key (select 'element-with-markers) from where narrow order-by) "Like `org-ql-select', but arguments are named more like a SQL query.