summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-04-02 19:19:54 +0300
committerThanos Apollo <[email protected]>2024-04-02 19:24:48 +0300
commit9b079a48eeda16d29eb937e2dd4905a20ec0ec42 (patch)
tree54148ad7609d96101f266a77af230b5c86ea0f43 /gnosis.el
parent9e679fe36adda32978ae0aaf15e41afbca024be4 (diff)
gnosis-dashboard: Add note-ids argument
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el28
1 files changed, 16 insertions, 12 deletions
diff --git a/gnosis.el b/gnosis.el
index 28a7b20..3c627a8 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1709,22 +1709,26 @@ DASHBOARD: Dashboard to return to after editing."
tabulated-list-sort-key nil))
;;;###autoload
-(cl-defun gnosis-dashboard (&optional dashboard-type)
+(cl-defun gnosis-dashboard (&optional dashboard-type (note-ids nil))
"Display gnosis dashboard.
+NOTE-IDS: List of note ids to display on dashboard. When nil, prompt
+for dashboard type.
+
DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard."
(interactive)
- (let ((type (or dashboard-type
- (cadr (read-multiple-choice
- "Display dashboard for:"
- '((?N "Notes")
- (?D "Decks")))))))
- (pop-to-buffer "*gnosis-dashboard*")
- (gnosis-dashboard-mode)
- (pcase type
- ("Notes" (gnosis-dashboard-output-notes))
- ("Decks" (gnosis-dashboard-output-decks)))
- (tabulated-list-print t)))
+ (pop-to-buffer "*gnosis-dashboard*")
+ (gnosis-dashboard-mode)
+ (if note-ids (gnosis-dashboard-output-notes note-ids)
+ (pcase (or dashboard-type (cadr (read-multiple-choice
+ "Display dashboard for:"
+ '((?N "Notes")
+ (?D "Decks")
+ (?T "Tags")))))
+ ("Notes" (gnosis-dashboard-output-notes (gnosis-collect-note-ids)))
+ ("Decks" (gnosis-dashboard-output-decks))
+ ("Tags" (gnosis-dashboard-output-notes (gnosis-collect-note-ids :tags t)))))
+ (tabulated-list-print t))
(defun gnosis-db-init ()
"Create gnosis essential directories & database."