From 55ec53bddd50cbb6cdde897ba85a62336659cf44 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 25 Dec 2023 17:35:56 +0200 Subject: Add gnosis-dir & subdirectorites/files All files for gnosis will be located in gnosis-dir --- gnosis.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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." -- cgit v1.2.3