summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/gnosis.el b/gnosis.el
index 67ed0fd..f06bf01 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -427,15 +427,17 @@ Set SPLIT to t to split all input given."
"Suspend all note(s) with DECK id.
When called with a prefix, unsuspends all notes in deck."
- (let ((notes (gnosis-select 'id 'notes `(= deck-id ,deck)))
- (suspend (if current-prefix-arg 0 1))
- (note-count 0))
- (cl-loop for note in notes
- do (gnosis-update 'review-log `(= suspend ,suspend) `(= id ,(car note)))
+ (let* ((notes (gnosis-select 'id 'notes `(= deck-id ,deck) t))
+ (suspend (if current-prefix-arg 0 1))
+ (note-count 0)
+ (confirm (y-or-n-p (if (= suspend 0) "Unsuspend all notes for deck? " "Suspend all notes for deck? "))))
+ (when confirm
+ (cl-loop for note in notes
+ do (gnosis-update 'review-log `(= suspend ,suspend) `(= id ,note))
(setq note-count (1+ note-count))
finally (if (equal suspend 0)
(message "Unsuspended %s notes" note-count)
- (message "Suspended %s notes" note-count)))))
+ (message "Suspended %s notes" note-count))))))
(defun gnosis-suspend-tag ()
"Suspend all note(s) with tag.