summaryrefslogtreecommitdiff
path: root/gnosis-dashboard.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-03 19:08:17 +0300
committerThanos Apollo <[email protected]>2024-08-03 19:08:17 +0300
commit3bde664fe2ac12dad1f2e4ba9e34e26ff66fadc6 (patch)
tree5fa59982d00f700f0ce8959c6badc8e9937e2f8b /gnosis-dashboard.el
parentdda4e42b49dc44c8aeef2bdfcc33698d71fd4434 (diff)
Rewrite dashboard-output-decks.
* Remove deprecated values. * Replace local-set-key for gnosis-dashboard-decks-mode.
Diffstat (limited to 'gnosis-dashboard.el')
-rw-r--r--gnosis-dashboard.el34
1 files changed, 5 insertions, 29 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 2813cc2..acd3b01 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -346,42 +346,18 @@ Optionally, use when using multiple months."
"Return deck contents for gnosis dashboard."
(pop-to-buffer-same-window "*gnosis-dashboard*")
(gnosis-dashboard-mode)
+ (gnosis-dashboard-decks-mode)
(setq tabulated-list-format [("Name" 15 t)
- ("failure-factor" 15 t)
- ("ef-increase" 15 t)
- ("ef-decrease" 15 t)
- ("ef-threshold" 15 t)
- ("Initial Interval" 20 t)
- ("Total Notes" 10 t)])
+ ("Total Notes" 10 gnosis-dashboard-sort-total-notes)])
(tabulated-list-init-header)
(setq tabulated-list-entries
(cl-loop for id in (gnosis-select 'id 'decks '1=1 t)
for output = (gnosis-dashboard-output-deck id)
when output
collect (list (number-to-string id) (vconcat output))))
- (local-set-key (kbd "e") #'gnosis-dashboard-edit-deck)
- (local-set-key (kbd "a") #'(lambda () "Add deck & refresh" (interactive)
- (gnosis-add-deck (read-string "Deck name: "))
- (gnosis-dashboard-output-decks)
- (revert-buffer t t t)))
- (local-set-key (kbd "s") #'(lambda () "Suspend notes" (interactive)
- (gnosis-suspend-deck
- (string-to-number (tabulated-list-get-id)))
- (gnosis-dashboard-output-decks)
- (revert-buffer t t t)))
- (local-set-key (kbd "d") #'(lambda () "Delete deck" (interactive)
- (gnosis-delete-deck (string-to-number (tabulated-list-get-id)))
- (gnosis-dashboard-output-decks)
- (revert-buffer t t t)))
- (local-set-key (kbd "RET") #'(lambda () "View notes of deck" (interactive)
- (gnosis-dashboard--search "notes"
- (gnosis-collect-note-ids
- :deck (string-to-number (tabulated-list-get-id)))))))
-
-(defun gnosis-dashboard-edit-note (&optional dashboard)
- "Get note id from tabulated list and edit it.
-
-DASHBOARD: Dashboard to return to after editing."
+ (tabulated-list-print t)
+ (setf gnosis-dashboard--current `(:type decks :ids ,(gnosis-select 'id 'decks '1=1 t))))
+
(interactive)
(let ((id (tabulated-list-get-id))
(dashboard (or dashboard "notes")))