summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/gnosis.el b/gnosis.el
index f88a1f2..d973d64 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1526,8 +1526,23 @@ name and all notes formatted as nested lists"
(defun gnosis-dashboard-output-notes ()
"Return note contents for gnosis dashboard."
(let ((max-id (apply 'max (gnosis-select 'id 'notes '1=1 t))))
- (cl-loop for id from 1 to max-id collect
- (list (number-to-string id) (vconcat (gnosis-dashboard-output-note id))))))
+ (setq tabulated-list-format [("Main" 30 t)
+ ("Options" 20 t)
+ ("Answer" 25 t)
+ ("Tags" 25 t)
+ ("Type" 10 t)
+ ("Suspend" 2 t)])
+ (tabulated-list-init-header)
+ (setf tabulated-list-entries
+ (cl-loop for id from 1 to max-id
+ for output = (gnosis-dashboard-output-note id)
+ when output
+ collect (list (number-to-string id) (vconcat output))))
+ (local-set-key (kbd "e") #'gnosis-dashboard-edit-note)
+ (local-set-key (kbd "s") #'(lambda () (interactive) (gnosis-suspend-note
+ (string-to-number (tabulated-list-get-id)))
+ (gnosis-dashboard-output-notes)
+ (revert-buffer t t t)))))
(defun gnosis-dashboard-edit-note ()
"Get note id from tabulated list and edit it."