From 2cd612d1ba3f318730067da63eb0d04eb0fc0e93 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Sat, 24 Aug 2019 19:40:19 +0900 Subject: [PATCH] Allow changing the buffer org-ql-occur runs on --- org-ql.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-ql.el b/org-ql.el index bf37ba6..981dfd6 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1003,7 +1003,7 @@ A and B are Org headline elements." ;;;; Functions/Occur -(cl-defun org-ql-occur (query &key keep-previous) +(cl-defun org-ql-occur (query &key (buffer (current-buffer)) keep-previous) "Make a compact tree which shows all matches of the query. QUERY is an `org-ql' query sexp (quoted, since this is a @@ -1019,7 +1019,7 @@ will be kept, to allow stacking of calls to this command." (unless keep-previous (org-remove-occur-highlights nil nil t)) ;; (push (cons regexp callback) org-occur-parameters) - (let ((result (org-ql-select (current-buffer) query + (let ((result (org-ql-select buffer query :action (lambda () (when org-highlight-sparse-tree-matches