Add: helm-org-ql-views, helm-source-org-ql-views

This commit is contained in:
Adam Porter 2019-10-08 16:45:19 -05:00
parent 13723f8163
commit da9be83326
3 changed files with 28 additions and 10 deletions

View file

@ -66,6 +66,15 @@
"Keymap for `helm-org-ql' sessions.
Based on `helm-map'.")
(defvar helm-source-org-ql-views
(helm-build-sync-source "Org QL Views"
:candidates (lambda ()
(->> org-ql-views
(-map #'car)
(-sort #'string<)))
:action (list (cons "Show view" #'org-ql-view)))
"Helm source for `org-ql-views'.")
(defvar-local helm-org-ql-buffers-files nil
"Used for `helm-org-ql-save'.")
@ -166,6 +175,12 @@ Is transformed into this query:
(query (org-ql--plain-query helm-pattern)))
(helm-run-after-exit #'org-ql-search buffers-files query)))
;;;###autoload
(defun helm-org-ql-views ()
"Show an `org-ql' view selected with Helm."
(interactive)
(helm :sources helm-source-org-ql-views))
;;;; Functions
(cl-defun helm-org-ql-source (buffers-files &key (name "helm-org-ql"))