From e24fd3159c0b1ec8b796554c96d300cb3935dbb2 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 4 Aug 2024 08:27:39 +0300 Subject: New function: dashboard-suspend-tag. * Toggle suspend for all notes of tag. * Bind it to "s" under dashboard-tags-mode-map. --- gnosis-dashboard.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 473238b..1dcf9fb 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -294,6 +294,15 @@ 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-suspend-tag (&optional tag) + "Suspend notes of TAG." + (interactive) + (let* ((tag (or tag (tabulated-list-get-id))) + (notes (gnosis-get-tag-notes tag))) + (when (y-or-n-p "Toggle SUSPEND for tagged notes?") + (cl-loop for note in notes + do (gnosis-suspend-note note t))))) + (defun gnosis-dashboard-tag-view-notes (&optional tag) "View notes for TAG." (interactive) @@ -303,6 +312,7 @@ Optionally, use when using multiple months." (defvar-keymap gnosis-dashboard-tags-mode-map "RET" #'gnosis-dashboard-tag-view-notes "e" #'gnosis-dashboard-rename-tag + "s" #'gnosis-dashboard-suspend-tag "r" #'gnosis-dashboard-rename-tag "g" #'gnosis-dashboard-return) -- cgit v1.2.3