summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-04-04 01:43:47 +0100
committerjao <jao@gnu.org>2024-04-04 01:43:47 +0100
commit5be6c3e299f146589a263bf1fe69b4207c23b7bd (patch)
tree03ebb3fc9e7770f855826c60a6da90596ddfb968
parentecfc0e326c82394432588ff42eae672a7d953379 (diff)
downloadelibs-5be6c3e299f146589a263bf1fe69b4207c23b7bd.tar.gz
elibs-5be6c3e299f146589a263bf1fe69b4207c23b7bd.tar.bz2
jao-org-notes: group by title/tags
-rw-r--r--lib/doc/jao-org-notes.el6
1 files changed, 6 insertions, 0 deletions
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))))