Skip to content

Support Ivy and/or completing-read #63

@tumashu

Description

@tumashu

For example:

  (defun ivy-org-ql-agenda-files ()
    (interactive)
    (let ((files (org-agenda-files)))
      (ivy-read
       "Query: "
       #'(lambda (input)
           (let ((query (org-ql--plain-query input)))
             (when query
               (ignore-errors
                 (org-ql-select files query
                   :action (lambda ()
                             (propertize (org-get-heading t)
                                         'marker (copy-marker (point)))))))))
       :dynamic-collection t
       :action #'ivy-org-ql-agenda-goto)))

  (defun ivy-org-ql-agenda-goto (headline)
    (interactive)
    (let ((marker (get-text-property 0 'marker headline)))
      (when (markerp marker)
        (switch-to-buffer (marker-buffer marker))
        (goto-char marker)
        (org-show-entry))))

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions