summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-12-26 19:24:08 +0000
committerYann Herklotz <git@yannherklotz.com>2022-12-26 19:24:08 +0000
commiteec5d6bb343e9d1718466c24c7f2df260c66a682 (patch)
tree911153a41f5e77fde1d18bed6b25f1751959d40b
parentec5ad49bbebbbd1eb0027862dc52811370e2a6d8 (diff)
downloadorg-zettelkasten-eec5d6bb343e9d1718466c24c7f2df260c66a682.tar.gz
org-zettelkasten-eec5d6bb343e9d1718466c24c7f2df260c66a682.zip
Add Org agenda search view for zettelkasten files
-rw-r--r--org-zettelkasten.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/org-zettelkasten.el b/org-zettelkasten.el
index b94afb5..f9e2e23 100644
--- a/org-zettelkasten.el
+++ b/org-zettelkasten.el
@@ -156,10 +156,20 @@ directory."
(let ((current-id (org-entry-get nil "CUSTOM_ID")))
(lgrep (concat "[:[]." current-id "]") "*.org" org-zettelkasten-directory)))
+(defun org-zettelkasten-agenda-search-view ()
+ "Search for text using Org agenda in Zettelkasten files."
+ (interactive)
+ (let ((org-agenda-files
+ (mapcar #'org-zettelkasten-abs-file
+ (mapcar #'cdr org-zettelkasten-mapping))))
+ (org-search-view)))
+
(defvar org-zettelkasten-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "n" #'org-zettelkasten-create-dwim)
(define-key map "C-s" #'org-zettelkasten-search-current-id)
+ (define-key map "s" #'org-zettelkasten-agenda-search-view)
+ (define-key map "C-g" #'org-zettelkasten-goto-id)
map))
(defvar org-zettelkasten-minor-mode-map