Add: (org-ql-select) Accept a function for buffers-files
This commit is contained in:
parent
e60e217312
commit
c286ab1967
3 changed files with 4 additions and 4 deletions
|
|
@ -482,6 +482,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
|
||||||
+ Predicate =(path)=.
|
+ Predicate =(path)=.
|
||||||
+ Option =org-ql-views= may now be customized in a guided, structured way with the customization UI (e.g. =M-x customize-option RET org-ql-views RET=, or press =c= in the =org-ql-view-sidebar= buffer).
|
+ Option =org-ql-views= may now be customized in a guided, structured way with the customization UI (e.g. =M-x customize-option RET org-ql-views RET=, or press =c= in the =org-ql-view-sidebar= buffer).
|
||||||
+ Enable more Org Agenda commands in =org-ql-view= buffers (e.g. setting deadlines and scheduling). (Fixes [[https://github.com/alphapapa/org-ql/issues/35][#35]]. Thanks to [[https://github.com/mz-pdm][Milan Zamazal]] and [[https://github.com/mskorzhinskiy][Mikhail Skorzhinskii]].)
|
+ Enable more Org Agenda commands in =org-ql-view= buffers (e.g. setting deadlines and scheduling). (Fixes [[https://github.com/alphapapa/org-ql/issues/35][#35]]. Thanks to [[https://github.com/mz-pdm][Milan Zamazal]] and [[https://github.com/mskorzhinskiy][Mikhail Skorzhinskii]].)
|
||||||
|
+ Function =org-ql-select='s =buffers-files= argument can be a function which returns a list of buffers and/or files.
|
||||||
|
|
||||||
*Changed*
|
*Changed*
|
||||||
+ Predicate =heading= now accepts multiple regexps, which are matched with boolean =AND=.
|
+ Predicate =heading= now accepts multiple regexps, which are matched with boolean =AND=.
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,6 @@ Interactively, prompt for NAME."
|
||||||
(cl-typecase view
|
(cl-typecase view
|
||||||
(function (call-interactively view))
|
(function (call-interactively view))
|
||||||
(list (-let* (((&plist :buffers-files :query :sort :narrow :super-groups :title) view)
|
(list (-let* (((&plist :buffers-files :query :sort :narrow :super-groups :title) view)
|
||||||
(buffers-files (cl-typecase buffers-files
|
|
||||||
(function (funcall buffers-files))
|
|
||||||
(list buffers-files)))
|
|
||||||
(super-groups (cl-typecase super-groups
|
(super-groups (cl-typecase super-groups
|
||||||
(symbol (symbol-value super-groups))
|
(symbol (symbol-value super-groups))
|
||||||
(list super-groups))))
|
(list super-groups))))
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,8 @@ For convenience, arguments should be unquoted."
|
||||||
(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.
|
||||||
|
|
||||||
BUFFERS-OR-FILES is a one or a list of files and/or buffers.
|
BUFFERS-OR-FILES is a file or buffer, a list of files and/or
|
||||||
|
buffers, or a function which returns such a list.
|
||||||
|
|
||||||
QUERY is an `org-ql' query sexp (quoted, since this is a
|
QUERY is an `org-ql' query sexp (quoted, since this is a
|
||||||
function).
|
function).
|
||||||
|
|
@ -180,6 +181,7 @@ returns nil or non-nil."
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
(-let* ((buffers (->> (cl-typecase buffers-or-files
|
(-let* ((buffers (->> (cl-typecase buffers-or-files
|
||||||
(null (list (current-buffer)))
|
(null (list (current-buffer)))
|
||||||
|
(function (funcall buffers-or-files))
|
||||||
(list buffers-or-files)
|
(list buffers-or-files)
|
||||||
(otherwise (list buffers-or-files)))
|
(otherwise (list buffers-or-files)))
|
||||||
(--map (cl-etypecase it
|
(--map (cl-etypecase it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue