diff options
author | Thanos Apollo <[email protected]> | 2024-03-03 02:18:43 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-03 02:18:43 +0200 |
commit | 2d8cf433510b6e5bdf2b203d7b8b85b876b98e99 (patch) | |
tree | 516d7df9675842dce09305e09bb025a70ae18989 /gnosis.el | |
parent | 402809457745553b29eb685b4a875bdd81304dfd (diff) |
gnosis-suspend-deck: Add confirmation
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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. |