From 092b971499e7b22247ffc506a9b32fe7a1bec25d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 16 Jul 2024 17:17:46 +0300 Subject: gnosis-review: Move review funcs closer together --- gnosis.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/gnosis.el b/gnosis.el index ff35238..270e4d9 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1677,6 +1677,23 @@ NOTES: List of note ids" (gnosis-review-actions success note note-count)) finally (gnosis-review-commit note-count))))))) +;;;###autoload +(defun gnosis-review () + "Start gnosis review session." + (interactive) + ;; Refresh modeline + (setq gnosis-due-notes-total (length (gnosis-review-get-due-notes))) + (let ((review-type (gnosis-completing-read "Review: " '("Due notes" + "Due notes of deck" + "Due notes of specified tag(s)" + "All notes of tag(s)")))) + (pcase review-type + ("Due notes" (gnosis-review-session (gnosis-collect-note-ids :due t))) + ("Due notes of deck" (gnosis-review-session (gnosis-collect-note-ids :due t :deck (gnosis--get-deck-id)))) + ("Due notes of specified tag(s)" (gnosis-review-session (gnosis-collect-note-ids :due t :tags t))) + ("All notes of tag(s)" (gnosis-review-session (gnosis-collect-note-ids :tags t)))))) + + ;; Editing notes (defun gnosis-edit-read-only-values (&rest values) "Make the provided VALUES read-only in the whole buffer." @@ -1952,22 +1969,6 @@ to improve readability." (format "\n%s '%s" (symbol-name field) (prin1-to-string value))) (t (format "\n%s %s" (symbol-name field) (prin1-to-string value)))))))) -;;;###autoload -(defun gnosis-review () - "Start gnosis review session." - (interactive) - ;; Refresh modeline - (setq gnosis-due-notes-total (length (gnosis-review-get-due-notes))) - (let ((review-type (gnosis-completing-read "Review: " '("Due notes" - "Due notes of deck" - "Due notes of specified tag(s)" - "All notes of tag(s)")))) - (pcase review-type - ("Due notes" (gnosis-review-session (gnosis-collect-note-ids :due t))) - ("Due notes of deck" (gnosis-review-session (gnosis-collect-note-ids :due t :deck (gnosis--get-deck-id)))) - ("Due notes of specified tag(s)" (gnosis-review-session (gnosis-collect-note-ids :due t :tags t))) - ("All notes of tag(s)" (gnosis-review-session (gnosis-collect-note-ids :tags t)))))) - ;;; Database Schemas (defvar gnosis-db-schema-decks '([(id integer :primary-key :autoincrement) (name text :not-null) -- cgit v1.2.3