Fix: Add autoloads

Fixes #36.  Thanks to Akira Komamura (@akirak).
This commit is contained in:
Akira Komamura 2019-08-31 23:40:49 -05:00 committed by Adam Porter
parent 42947aa2df
commit 3a5e4a1e11
3 changed files with 11 additions and 0 deletions

View file

@ -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. /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 ** 0.2-pre
:PROPERTIES:
:ID: 67be09f9-e959-4333-9be2-93ad8f458fbe
:END:
*Added* *Added*
+ Function ~org-ql-query~, like ~org-ql-select~ but with arguments named more like a SQL query. + 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. + 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]].) + 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. + 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* *Compatibility*
+ Fixes for compatibility with Org 9.2. (Thanks to [[https://github.com/ataias][Ataias Pereira Reis]] and [[https://github.com/dakra][Daniel Kraus]].) + Fixes for compatibility with Org 9.2. (Thanks to [[https://github.com/ataias][Ataias Pereira Reis]] and [[https://github.com/dakra][Daniel Kraus]].)

View file

@ -120,6 +120,7 @@ e.g. `org-ql-search' as desired."
;; TODO: DRY these two macros. ;; TODO: DRY these two macros.
;;;###autoload
(cl-defmacro org-ql-agenda (&rest args) (cl-defmacro org-ql-agenda (&rest args)
"Display an agenda-like buffer of entries in FILES that match QUERY. "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-set-variable 'org-ql-views org-ql-views)
(customize-mark-to-save 'org-ql-views))) (customize-mark-to-save 'org-ql-views)))
;;;###autoload
(defun org-ql-view (&optional view) (defun org-ql-view (&optional view)
"Choose and display a view stored in `org-ql-views'." "Choose and display a view stored in `org-ql-views'."
(interactive (list (completing-read "View: " (mapcar #'car org-ql-views)))) (interactive (list (completing-read "View: " (mapcar #'car org-ql-views))))
(call-interactively (alist-get view org-ql-views nil nil #'string=))) (call-interactively (alist-get view org-ql-views nil nil #'string=)))
;;;###autoload
(cl-defun org-ql-view-recent-items (cl-defun org-ql-view-recent-items
(&key days type (&key days type
(files (org-agenda-files)) (files (org-agenda-files))
@ -392,6 +395,7 @@ after the block."
insert) insert)
(insert "\n"))) (insert "\n")))
;;;###autoload
(defalias 'org-ql-block 'org-ql-agenda-block) (defalias 'org-ql-block 'org-ql-agenda-block)
(defun org-ql-agenda--header-line-format (buffers-files query &optional title) (defun org-ql-agenda--header-line-format (buffers-files query &optional title)

View file

@ -120,6 +120,7 @@ match."
(push (list :name ',pred-name :fn ',fn-name :docstring ,docstring :args ',args) org-ql-predicates) (push (list :name ',pred-name :fn ',fn-name :docstring ,docstring :args ',args) org-ql-predicates)
(cl-defun ,fn-name ,args ,docstring ,@body)))) (cl-defun ,fn-name ,args ,docstring ,@body))))
;;;###autoload
(cl-defmacro org-ql (buffers-or-files query &key sort narrow action) (cl-defmacro org-ql (buffers-or-files query &key sort narrow action)
"Expands into a call to `org-ql-select' with the same arguments. "Expands into a call to `org-ql-select' with the same arguments.
For convenience, arguments should be unquoted." 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) (define-hash-table-test 'org-ql-hash-test #'equal (lambda (args)
(sxhash-equal (prin1-to-string args)))) (sxhash-equal (prin1-to-string args))))
;;;###autoload
(cl-defun org-ql-select (buffers-or-files query &key action narrow sort) (cl-defun org-ql-select (buffers-or-files query &key action narrow sort)
"Return items matching QUERY in BUFFERS-OR-FILES. "Return items matching QUERY in BUFFERS-OR-FILES.
@ -226,6 +228,7 @@ returns nil or non-nil."
((pred functionp) (sort items sort)) ((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"))))) (_ (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) (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. "Like `org-ql-select', but arguments are named more like a SQL query.