diff options
author | Thanos Apollo <[email protected]> | 2024-04-02 19:19:54 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-04-02 19:24:48 +0300 |
commit | 9b079a48eeda16d29eb937e2dd4905a20ec0ec42 (patch) | |
tree | 54148ad7609d96101f266a77af230b5c86ea0f43 | |
parent | 9e679fe36adda32978ae0aaf15e41afbca024be4 (diff) |
gnosis-dashboard: Add note-ids argument
-rw-r--r-- | gnosis.el | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -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." |