From 5be6c3e299f146589a263bf1fe69b4207c23b7bd Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 4 Apr 2024 01:43:47 +0100 Subject: jao-org-notes: group by title/tags --- lib/doc/jao-org-notes.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/doc/jao-org-notes.el b/lib/doc/jao-org-notes.el index 916a4c8..bd82543 100644 --- a/lib/doc/jao-org-notes.el +++ b/lib/doc/jao-org-notes.el @@ -66,6 +66,11 @@ (defvar jao-org-notes--grep-history nil) +(defun jao-org-notes--consult-group (m transform) + (or (and transform m) + (and (string-match-p "^[^:]+ + :" m) "tags") + "titles")) + (defun jao-org-notes--consult-rg (prompt &optional cat no-req cmd) (let ((default-directory (expand-file-name (or cat "") jao-org-notes-dir))) (consult--read @@ -76,6 +81,7 @@ :add-history (concat (consult--async-split-initial (thing-at-point 'symbol))) :require-match (not no-req) :category 'jao-org-notes-lookup + :group 'jao-org-notes--consult-group :lookup (lambda (cand cands &rest _) (or (cadr (assoc cand cands)) (substring cand 1))) :history '(:input jao-org-notes--grep-history)))) -- cgit v1.2.3