summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-04 09:20:39 +0200
committerThanos Apollo <[email protected]>2024-01-04 09:20:39 +0200
commit360fa413a3dd2c690604ac1c06d2e791a668fe2a (patch)
tree16afb25fbc9eb04ccd0e41805cb29dc6ac35282e /gnosis.el
parent258312a538be04a3812b7eb4d80123606338f432 (diff)
gnosis-db: Redo as defconst
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/gnosis.el b/gnosis.el
index bc6318f..f84b34a 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -54,10 +54,11 @@
(defvar gnosis-images-dir (concat (file-name-as-directory gnosis-dir) "images")
"Gnosis images directory.")
-(defvar gnosis-db (emacsql-sqlite (concat (file-name-as-directory gnosis-dir) "gnosis.db"))
- "Gnosis database file.
-
-WARNING: Do not change this value!")
+(defconst gnosis-db
+ (if (not (file-directory-p gnosis-dir))
+ (gnosis-db-init)
+ (emacsql-sqlite (concat (file-name-as-directory gnosis-dir) "gnosis.db")))
+ "Gnosis database file. WARNING: Do not change this value!")
(defvar gnosis-testing nil
"When t, warn user he is in a testing environment.")
@@ -1175,7 +1176,7 @@ review."
(plist-get note :answer)
(plist-get note :extra-notes)
(plist-get note :tags)
- 0
+ suspended
(plist-get note :image)
(plist-get note :second-image)))))
@@ -1188,7 +1189,7 @@ review."
(let ((review-type (completing-read "Review: " '("Due notes"
"Due notes of deck"
"Due notes of specified tag(s)"
- "Notes with tag(s)"))))
+ "All notes of tag(s)"))))
(pcase review-type
("Due notes" (gnosis-review--session (gnosis-review-get-due-notes)))
("Due notes of deck" (gnosis-review--session (gnosis-get-deck-due-notes)))