summaryrefslogtreecommitdiff
path: root/gnosis-dashboard.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-11 23:06:47 +0300
committerThanos Apollo <[email protected]>2024-08-11 23:06:47 +0300
commitf7be6913f6ba1e7b69ce2a04c16b10deacbcf4af (patch)
treed099b0684ebdcfe61d4c39a80c495d35efb59586 /gnosis-dashboard.el
parent73329e0ebfda93ebe99471788c2a9f1d17ca954b (diff)
New function: dashboard-rename-deck.
* Rename deck during dashboard view. * Bind function to "e" and "r".
Diffstat (limited to 'gnosis-dashboard.el')
-rw-r--r--gnosis-dashboard.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 1dcf9fb..efc50fe 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -294,6 +294,14 @@ Optionally, use when using multiple months."
(new-tags (cl-substitute new-tag tag tags :test #'string-equal)))
(gnosis-update 'notes `(= tags ',new-tags) `(= id ,note))))))
+(defun gnosis-dashboard-rename-deck (&optional deck-id new-name)
+ "Rename deck where DECK-ID with NEW-NAME."
+ (interactive)
+ (let ((deck-id (or deck-id (string-to-number (tabulated-list-get-id))))
+ (new-name (or new-name (read-string "New deck name: "))))
+ (gnosis-update 'decks `(= name ,new-name) `(= id ,deck-id))
+ (gnosis-dashboard-output-decks)))
+
(defun gnosis-dashboard-suspend-tag (&optional tag)
"Suspend notes of TAG."
(interactive)
@@ -346,7 +354,8 @@ Optionally, use when using multiple months."
collect (format "%s" item)))
(defvar-keymap gnosis-dashboard-decks-mode-map
- "e" #'gnosis-dashboard-edit-deck
+ "e" #'gnosis-dashboard-rename-deck
+ "r" #'gnosis-dashboard-rename-deck
"a" #'gnosis-dashboard-decks-add
"s" #'gnosis-dashboard-decks-suspend-deck
"d" #'gnosis-dashboard-decks-delete