summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-10-23 03:53:55 +0300
committerThanos Apollo <[email protected]>2024-10-23 04:11:16 +0300
commit17d93aee78d93bd47bd6e9e29f4e798fad297754 (patch)
tree7d8a280d0b3dbfdc69cff8c9e8e2efbd0d494dd4 /gnosis.el
parent505ce5cff58923acec6e83351042f2b1d150f65c (diff)
dashboard: Rewrite without using widgets & fix typos
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el62
1 files changed, 30 insertions, 32 deletions
diff --git a/gnosis.el b/gnosis.el
index 0efd544..ec97107 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -3026,7 +3026,7 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard."
;;;###autoload
(defun gnosis-dashboard ()
- "Test function to create an editable field and a search button."
+ "Launch gnosis dashboard."
(interactive)
(delete-other-windows)
(let ((buffer-name gnosis-dashboard-buffer-name)
@@ -3035,48 +3035,46 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard."
(kill-buffer buffer-name)) ;; Kill the existing buffer if it exists
(let ((buffer (get-buffer-create buffer-name)))
(with-current-buffer buffer
- (widget-insert "\n"
- (gnosis-center-string
- (format "%s" (propertize "Gnosis Dashboard" 'face
- 'gnosis-face-dashboard-header))))
+ (insert "\n"
+ (gnosis-center-string
+ (format "%s" (propertize "Gnosis Dashboard" 'face
+ 'gnosis-face-dashboard-header))))
(gnosis-insert-separator)
- ;; (widget-insert (gnosis-center-string (propertize "Stats:" 'face 'underline)) "\n\n")
- (widget-insert (gnosis-center-string
- (format "Reviewed today: %s (New: %s)"
- (propertize
- (number-to-string (gnosis-get-date-total-notes))
- 'face
- 'font-lock-variable-use-face)
- (propertize
- (number-to-string (gnosis-get-date-new-notes))
- 'face
- 'font-lock-keyword-face))))
+ (insert (gnosis-center-string
+ (format "\nReviewed today: %s (New: %s)"
+ (propertize
+ (number-to-string (gnosis-get-date-total-notes))
+ 'face
+ 'font-lock-variable-use-face)
+ (propertize
+ (number-to-string (gnosis-get-date-new-notes))
+ 'face
+ 'font-lock-keyword-face))))
(insert "\n")
- (widget-insert (gnosis-center-string
- (format "Due notes: %s (Overdue: %s)"
- (propertize
- (number-to-string (length due-notes))
- 'face 'error)
- (propertize
- (number-to-string (length (gnosis-review-get-overdue-notes due-notes)))
- 'face 'warning))))
+ (insert (gnosis-center-string
+ (format "Due notes: %s (Overdue: %s)"
+ (propertize
+ (number-to-string (length due-notes))
+ 'face 'error)
+ (propertize
+ (number-to-string
+ (length (gnosis-review-get-overdue-notes due-notes)))
+ 'face 'warning))))
(insert "\n\n")
- (widget-insert (gnosis-center-string
+ (insert (gnosis-center-string
(format "Daily Average: %s"
- (propertize (number-to-string (gnosis-dashboard-output-average-rev))
- 'face 'font-lock-type-face))))
+ (propertize
+ (number-to-string (gnosis-dashboard-output-average-rev))
+ 'face 'font-lock-type-face))))
(insert "\n")
- (widget-insert (gnosis-center-string
+ (insert (gnosis-center-string
(format "Current streak: %s days"
(propertize
(number-to-string
(gnosis-dashboard--streak
(gnosis-select 'date 'activity-log '1=1 t)))
'face 'success))))
- (insert "\n\n")
- ;; (gnosis-dashboard-month-overview (or gnosis-dashboard-months 0))
- (use-local-map widget-keymap)
- (widget-setup))
+ (insert "\n\n"))
(pop-to-buffer-same-window buffer)
(goto-char (point-min))
(gnosis-dashboard-enable-mode)