summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-25 17:35:56 +0200
committerThanos Apollo <[email protected]>2023-12-25 17:35:56 +0200
commit55ec53bddd50cbb6cdde897ba85a62336659cf44 (patch)
tree44804c9480e1711800ef53b096cfff1b06cc234f
parenta3e2f9a9289f709bad01e44f442dfaa762533b08 (diff)
Add gnosis-dir & subdirectorites/files
All files for gnosis will be located in gnosis-dir
-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."