diff options
author | Thanos Apollo <[email protected]> | 2024-08-03 18:50:27 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-03 18:50:27 +0300 |
commit | 515a7009c535346a12ecf3ec823f4d0963bc0c61 (patch) | |
tree | fe2c20c406f5390a49d52cfe82bb8cf17c94dad9 /gnosis-dashboard.el | |
parent | 13d3810925ed5a32ba4e63ecd0cda1acef488d46 (diff) |
Refactor dashboard-output-notes
* Replace local-set-key with dashboard-notes-mode.
* Update dashboard--current-values
Diffstat (limited to 'gnosis-dashboard.el')
-rw-r--r-- | gnosis-dashboard.el | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 06bb481..a4d22a4 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -244,6 +244,7 @@ Optionally, use when using multiple months." (cl-assert (listp note-ids) t "`note-ids' must be a list of note ids.") (pop-to-buffer-same-window "*gnosis-dashboard*") (gnosis-dashboard-mode) + (gnosis-dashboard-notes-mode) (setf tabulated-list-format `[("Main" ,(/ (window-width) 4) t) ("Options" ,(/ (window-width) 6) t) ("Answer" ,(/ (window-width) 6) t) @@ -256,22 +257,8 @@ Optionally, use when using multiple months." collect (list (number-to-string id) (vconcat output))) gnosis-dashboard-note-ids note-ids) (tabulated-list-init-header) - ;; Keybindings, for editing, suspending, deleting notes. - ;; We use `local-set-key' to bind keys to the buffer to avoid - ;; conflicts when using the dashboard for displaying either notes - ;; or decks. - (local-set-key (kbd "e") #'gnosis-dashboard-edit-note) - (local-set-key (kbd "s") #'(lambda () (interactive) - (gnosis-suspend-note (string-to-number (tabulated-list-get-id))) - (gnosis-dashboard-output-notes gnosis-dashboard-note-ids) - (revert-buffer t t t))) - (local-set-key (kbd "a") #'gnosis-add-note) - (local-set-key (kbd "r") #'gnosis-dashboard) - (local-set-key (kbd "d") #'(lambda () (interactive) - (gnosis-delete-note (string-to-number (tabulated-list-get-id))) - (gnosis-dashboard-output-notes gnosis-dashboard-note-ids) - (revert-buffer t t t))) - (local-unset-key (kbd "RET"))) + (tabulated-list-print t) + (setf gnosis-dashboard--current `(:type notes :ids ,note-ids))) (defun gnosis-dashboard-deck-note-count (id) "Return total note count for deck with ID." |