summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-03-03 02:17:45 +0200
committerThanos Apollo <[email protected]>2024-03-03 02:17:45 +0200
commitaddf89bddb9f1e9484959cf00e315d625f89336c (patch)
treed2c4b50fb90ebd51146a1815725ad2aec754821d /gnosis.el
parent892735c7fa2215b4902f8d993f0b6c85083de768 (diff)
gnosis-delete-deck: Rewrite
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/gnosis.el b/gnosis.el
index 2cb4d44..3d1b50a 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -407,18 +407,14 @@ Set SPLIT to t to split all input given."
(gnosis-get 'id 'decks `(= name ,deck)))
;;;###autoload
-(defun gnosis-delete-deck (deck)
+(defun gnosis-delete-deck (id)
"Delete DECK."
- (interactive (list (gnosis--get-deck-name)))
- (gnosis--delete 'decks `(= name ,deck))
- (message "Deleted deck %s" deck))
+ (interactive (list (gnosis--get-deck-id)))
+ (let ((deck-name (gnosis--get-deck-name id)))
+ (when (y-or-n-p (format "Delete deck `%s'? " deck-name))
+ (gnosis--delete 'decks `(= id ,id))
+ (message "Deleted deck `%s'" deck-name))))
-;; TODO: Redo this as a single function
-(cl-defun gnosis-suspend-note (id &optional (suspend 1))
- "Suspend note with ID.
-
-SUSPEND: 1 to suspend, 0 to unsuspend."
- (gnosis-update 'review-log `(= suspend ,suspend) `(= id ,id)))
(cl-defun gnosis-suspend-deck (&optional (deck (gnosis--get-deck-id)))
"Suspend all note(s) with DECK id.