summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/gnosis.el b/gnosis.el
index ca0ef63..d92745c 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -43,7 +43,21 @@
:group 'external
:prefix "gnosis-")
-(defvar gnosis-db (emacsql-sqlite (concat user-emacs-directory "gnosis.db")))
+(defcustom gnosis-dir (concat user-emacs-directory "gnosis")
+ "Gnosis directory."
+ :type 'directory
+ :group 'gnosis)
+
+
+(defvar gnosis-images-dir (concat gnosis-dir "/" "images")
+ "Gnosis images directory.")
+
+(unless (file-exists-p gnosis-images-dir)
+ (make-directory gnosis-dir)
+ (make-directory gnosis-images-dir))
+
+(defvar gnosis-db (emacsql-sqlite (concat gnosis-dir "/" "gnosis.db"))
+ "Gnosis database.")
(cl-defun gnosis--select (value table &optional (restrictions '1=1))
"Select VALUE from TABLE, optionally with RESTRICTIONS."