summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-03 18:49:09 +0300
committerThanos Apollo <[email protected]>2024-08-03 18:49:09 +0300
commit13d3810925ed5a32ba4e63ecd0cda1acef488d46 (patch)
tree5e35bb2f7c58637c31c546736dcf601f9b92aafc
parentd641ce4b86bba8cd3c9113690a5ad46f4d8bd5dc (diff)
Add dashboard-notes-mode & it's map.
* Instead of using local-set-key, we will be using a minor mode for each dashboard-output.
-rw-r--r--gnosis-dashboard.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 1503a67..06bb481 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -223,6 +223,22 @@ Optionally, use when using multiple months."
(gnosis-delete-note (string-to-number (tabulated-list-get-id)))
(gnosis-dashboard-output-notes gnosis-dashboard-note-ids)
(revert-buffer t t t)))
+
+(defvar-keymap gnosis-dashboard-notes-mode-map
+ :doc "Keymap for notes dashboard."
+ "e" #'gnosis-dashboard-edit-note
+ "s" #'gnosis-dashboard-suspend-note
+ "a" #'gnosis-add-note
+ "r" #'gnosis-dashboard-return
+ "g" #'gnosis-dashboard-return
+ "d" #'gnosis-dashboard-delete
+ "m" #'gnosis-dashboard-mark-toggle
+ "u" #'gnosis-dashboard-mark-toggle)
+
+(define-minor-mode gnosis-dashboard-notes-mode
+ "Minor mode for gnosis dashboard notes output."
+ :keymap gnosis-dashboard-notes-mode-map)
+
(defun gnosis-dashboard-output-notes (note-ids)
"Return NOTE-IDS contents on gnosis dashboard."
(cl-assert (listp note-ids) t "`note-ids' must be a list of note ids.")