@@ -8842,7 +8842,8 @@ Also, no contexts are prompted in Inbox agenda.
8842
8842
(unless (eq major-mode 'org-agenda-mode) (user-error "Cannot run %s outside agenda view" this-command))
8843
8843
(when (and (memq this-command '(org-agenda yant/org-agenda-filter-by-location-context))
8844
8844
(not (string= org-agenda-name "Inbox items"))
8845
- (not (string= org-agenda-name "Hanging tasks")))
8845
+ (not (string= org-agenda-name "Hanging tasks"))
8846
+ (not (bound-and-true-p 'org-agenda-skip-location-context)))
8846
8847
(unless (local-variable-p 'org-global-tags-completion-table)
8847
8848
(setq-local org-global-tags-completion-table
8848
8849
(org-global-tags-completion-table)))
@@ -9844,12 +9845,31 @@ into (not QUERY)."
9844
9845
(defun yant/helm-org-ql-open-url (marker)
9845
9846
"Open URL from link"
9846
9847
(org-open-link-from-string (org-entry-get marker "Source")))
9848
+ (defun yant/helm-org-ql-show-in-agenda (markers)
9849
+ "Show agenda view with all the matches."
9850
+ (let ((org-agenda-skip-function `(lambda ()
9851
+ (org-back-to-heading t)
9852
+ (let ((markerhere (point-marker))
9853
+ (markers ',(helm-marked-candidates)))
9854
+ (setq markers (-filter (lambda (marker) (eq (current-buffer) (marker-buffer marker))) markers))
9855
+ (if (member (point-marker) markers)
9856
+ nil
9857
+ (while (and markers
9858
+ (> markerhere (car markers)))
9859
+ (setq markers (cdr markers)))
9860
+ (if (car markers)
9861
+ (goto-char (car markers))
9862
+ (goto-char (point-max)))))))
9863
+ (org-agenda-skip-location-context t)
9864
+ (org-agenda-sticky nil))
9865
+ (org-tags-view nil "!")))
9847
9866
:custom
9848
9867
(helm-org-ql-actions '(("Insert link to heading" . yant/helm-org-ql-create-link)
9849
9868
("Go to heading" . helm-org-ql-show-marker)
9850
9869
("Open heading source" . yant/helm-org-ql-open-url)
9851
9870
("Insert URL of heading" . yant/helm-org-ql-insert-url)
9852
- ("Refile heading(s) to heading at point" . helm-org--refile-heading-here)))
9871
+ ("Refile heading(s) to heading at point" . helm-org--refile-heading-here)
9872
+ ("Show in agenda" . yant/helm-org-ql-show-in-agenda)))
9853
9873
)
9854
9874
#+end_src
9855
9875
0 commit comments