summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-16 17:17:46 +0300
committerThanos Apollo <[email protected]>2024-07-16 17:17:46 +0300
commit092b971499e7b22247ffc506a9b32fe7a1bec25d (patch)
tree4204f7ff030bdca2305c9a22908291597c652ac5
parent10f24c92262fa38ccac8b51d91c22cd4105ca460 (diff)
gnosis-review: Move review funcs closer together
-rw-r--r--gnosis.el33
1 files 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)