alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.4k stars 110 forks source link

How to save query results into a variable? #333

Closed smahm006 closed 1 year ago

smahm006 commented 1 year ago

Hey I am trying to figure out how to save an org-ql query result into a list. I tried copying the org-bills-due.el example but it seems that org-ql has changed into a different function.

I have tried using org-ql-search but that just returns a buffer with the search result rather than saving to a variable.

My current very simple code which I would like to return all headings of level 2 into a variable.

(defun org_list ()
  (interactive)
  (let ((epics (org-ql-view "~/office/agenda/jira.org" `(level 2))))
        (princ epics)))

Currently this just prints the number 1.

alphapapa commented 1 year ago

https://github.com/alphapapa/org-ql#function-org-ql-select