From cd8f3d5a382e1c7b72f51255408a1a4d32dcf907 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 3 Aug 2024 18:45:36 +0300 Subject: New function: Add dashboard-return. * Returns to dashboard, refreshing for current values. --- gnosis-dashboard.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 9b7f4c8..528c570 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -67,6 +67,19 @@ '((t :foreground "#ff0a6a" :weight bold)) "My custom face for both light and dark backgrounds.") +(defun gnosis-dashboard-return (&optional current-values) + "Return to dashboard for CURRENT-VALUES." + (interactive) + (let* ((current-values (or current-values gnosis-dashboard--current)) + (type (plist-get current-values :type)) + (ids (plist-get current-values :ids))) + (cond ((eq type 'notes) + (gnosis-dashboard-output-notes ids)) + ((eq type 'decks ) + (gnosis-dashboard-output-decks)) + ((eq type 'tags ) + (gnosis-dashboard-output-tags))))) + (defun gnosis-dashboard-generate-dates (&optional year) "Return a list of all dates (year month day) for YEAR." (let* ((current-year (or (decoded-time-year (decode-time)) year)) -- cgit v1.2.3