summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-14 20:52:01 +0200
committerThanos Apollo <[email protected]>2023-12-14 20:52:01 +0200
commitb4e76ebbaba226b3df984177139b92185af5bcf4 (patch)
tree160076b81181503ca948af7b7c7e4eecc365cfd4
parentefcd91978b90c724577d266428976d351dd2500e (diff)
gnosis-init: Fix repetitive code
-rw-r--r--gnosis.el15
1 files changed, 5 insertions, 10 deletions
diff --git a/gnosis.el b/gnosis.el
index fa67683..214ecf7 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -240,15 +240,10 @@ TAGS are used to organize questions."
"Create notes content table."
(interactive)
;;(make-directory (concat user-emacs-directory "gnosis"))
- (condition-case nil
- (gnosis--drop-table 'notes)
- (error (message "No NOTES table to drop.")))
- (condition-case nil
- (gnosis--drop-table 'decks)
- (error (message "No DECKS table to drop.")))
- (condition-case nil
- (gnosis--drop-table 'review)
- (error (message "No REVIEW table to drop.")))
+ (dolist (table '(notes decks review review-log))
+ (condition-case nil
+ (gnosis--drop-table table)
+ (error (message "No %s table to drop." table))))
;; Enable foreign_keys
(emacsql gnosis-db "PRAGMA foreign_keys = ON")
;; Create decks table
@@ -273,7 +268,7 @@ TAGS are used to organize questions."
;; Gnosis Algorithm ;;
;;;;;;;;;;;;;;;;;;;;;;
-(defun gnosis-current-date (&optional offset)
+(defun gnosis-date-current (&optional offset)
"Return the current date in a list (year month day).
Optional integer OFFSET is a number of days from the current date."
(let* ((now (decode-time))