mirror of
https://github.com/chrisbarrett/nursery
synced 2025-09-02 14:53:31 -05:00
Teach org-roam-search to respect tags filters
This commit is contained in:
@@ -195,40 +195,41 @@ QUERY is a PRCE regexp string that will be passed to ripgrep."
|
|||||||
(not (string-prefix-p "(" input)))
|
(not (string-prefix-p "(" input)))
|
||||||
(format "(%s)" input)
|
(format "(%s)" input)
|
||||||
input))))
|
input))))
|
||||||
(org-roam-review-display-buffer-and-select
|
(let ((nodes (org-roam-search--ripgrep-for-nodes query)))
|
||||||
(org-roam-review-create-buffer
|
(org-roam-review-display-buffer-and-select
|
||||||
:title (format "Search Results: %s" query)
|
(org-roam-review-create-buffer
|
||||||
:placeholder "No search results"
|
:title (format "Search Results: %s" query)
|
||||||
:buffer-name org-roam-search-buffer-name
|
:placeholder "No search results"
|
||||||
:nodes
|
:buffer-name org-roam-search-buffer-name
|
||||||
(lambda ()
|
:nodes
|
||||||
(org-roam-search--ripgrep-for-nodes query))
|
(lambda ()
|
||||||
:render
|
(seq-remove #'org-roam-review-node-ignored-p nodes))
|
||||||
(-lambda ((&plist :nodes :placeholder :root-section))
|
:render
|
||||||
(cond
|
(-lambda ((&plist :nodes :placeholder :root-section))
|
||||||
((null nodes)
|
(cond
|
||||||
(insert placeholder)
|
((null nodes)
|
||||||
(newline))
|
(insert placeholder)
|
||||||
(t
|
(newline))
|
||||||
(pcase-dolist (`(,_file . ,group) (seq-group-by #'org-roam-node-file nodes))
|
(t
|
||||||
(when-let* ((top-node (-max-by (-on #'< #'org-roam-node-level)
|
(pcase-dolist (`(,_file . ,group) (seq-group-by #'org-roam-node-file nodes))
|
||||||
group) )
|
(when-let* ((top-node (-max-by (-on #'< #'org-roam-node-level)
|
||||||
(node-id (org-roam-node-id top-node))
|
group) )
|
||||||
(heading (org-link-display-format (org-roam-node-title top-node))))
|
(node-id (org-roam-node-id top-node))
|
||||||
(magit-insert-section section (org-roam-node-section node-id t)
|
(heading (org-link-display-format (org-roam-node-title top-node))))
|
||||||
(magit-insert-heading
|
(magit-insert-section section (org-roam-node-section node-id t)
|
||||||
(concat (propertize heading 'font-lock-face 'magit-section-heading)
|
(magit-insert-heading
|
||||||
" "
|
(concat (propertize heading 'font-lock-face 'magit-section-heading)
|
||||||
(when-let* ((mat (org-roam-review-node-maturity top-node)))
|
" "
|
||||||
(alist-get mat org-roam-review-maturity-emoji-alist nil nil #'equal))))
|
(when-let* ((mat (org-roam-review-node-maturity top-node)))
|
||||||
(oset section parent root-section)
|
(alist-get mat org-roam-review-maturity-emoji-alist nil nil #'equal))))
|
||||||
(oset section node top-node)
|
(oset section parent root-section)
|
||||||
(oset section washer
|
(oset section node top-node)
|
||||||
(lambda ()
|
(oset section washer
|
||||||
(org-roam-review-insert-preview top-node)
|
(lambda ()
|
||||||
(org-roam-search--highlight-matches query)
|
(org-roam-review-insert-preview top-node)
|
||||||
(magit-section-maybe-remove-visibility-indicator section))))))
|
(org-roam-search--highlight-matches query)
|
||||||
(org-roam-search--highlight-matches query)))))))
|
(magit-section-maybe-remove-visibility-indicator section))))))
|
||||||
|
(org-roam-search--highlight-matches query))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-roam-search-tags (query)
|
(defun org-roam-search-tags (query)
|
||||||
|
Reference in New Issue
Block a user