Change: (org-ql-agenda) Allow org-super-agenda-groups global value

Also, automatically quote :super-groups in macro expansion, and update
example in readme.
This commit is contained in:
Adam Porter 2018-12-18 06:16:53 -06:00
parent a58273c147
commit 748c3fb619
2 changed files with 21 additions and 15 deletions

View file

@ -44,7 +44,7 @@ Also included is ~org-ql-agenda~, which uses ~org-ql~ queries to select entries
(not (done)))
;; The `org-super-agenda-groups' setting is used automatically when set, or it
;; may be overriden by specifying it here:
:super-groups '((:name "Bills"
:super-groups ((:name "Bills"
:tag "bills")
(:todo ("SOMEDAY" "TO-READ" "CHECK" "TO-WATCH" "WATCHING")
:order 7)

View file

@ -63,7 +63,11 @@ NARROW, when non-nil, means to respect narrowing in buffers.
When nil, buffers are widened before being searched.
BUFFER, when non-nil, is a buffer or buffer name to display the
agenda in, rather than the default."
agenda in, rather than the default.
SUPER-GROUPS is used to bind variable `org-super-agenda-groups',
which see. If t, the existing value of `org-super-agenda-groups'
is used, rather than binding it locally."
(declare (indent defun)
(advertised-calling-convention (files-or-query &optional query &key sort narrow buffer super-groups) nil))
(cl-macrolet ((set-keyword-args (args)
@ -93,6 +97,8 @@ agenda in, rather than the default."
(`(,arg-pred)
;; Only query
(setq query arg-pred)))
(when (eq super-groups t)
(setq super-groups org-super-agenda-groups))
;; Call --agenda
`(org-ql-agenda--agenda ,files
;; TODO: Probably better to just use eval on org-ql rather than reimplementing parts of it here.
@ -100,7 +106,7 @@ agenda in, rather than the default."
:sort ',sort
:buffer ,buffer
:narrow ,narrow
:super-groups ,super-groups))))
:super-groups ',super-groups))))
;;;; Functions