summaryrefslogtreecommitdiff
path: root/gnosis-dashboard.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-03 18:48:36 +0300
committerThanos Apollo <[email protected]>2024-08-03 18:48:36 +0300
commitd641ce4b86bba8cd3c9113690a5ad46f4d8bd5dc (patch)
tree2a24813335b7619166fa66dd4873f2aa16dd9dab /gnosis-dashboard.el
parent98e0fd1247eba8ce65eae2da64511227a47f4f27 (diff)
New function: dashboard-delete.
* Delete note at point.
Diffstat (limited to 'gnosis-dashboard.el')
-rw-r--r--gnosis-dashboard.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index 8aa4a25..1503a67 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -215,6 +215,14 @@ Optionally, use when using multiple months."
(gnosis-dashboard-output-notes gnosis-dashboard-note-ids)
(revert-buffer t t t)))
+(defun gnosis-dashboard-delete ()
+ "Delete note."
+ (interactive)
+ (if gnosis-dashboard--selected-ids
+ (gnosis-dashboard-marked-delete)
+ (gnosis-delete-note (string-to-number (tabulated-list-get-id)))
+ (gnosis-dashboard-output-notes gnosis-dashboard-note-ids)
+ (revert-buffer t t t)))
(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.")