From cc1b398063582db2c6686c20caa18c4e9dda90c0 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 28 Dec 2023 08:13:09 +0200 Subject: Add gnosis-suspend-deck --- gnosis.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gnosis.el') diff --git a/gnosis.el b/gnosis.el index fdb1b7d..720076c 100644 --- a/gnosis.el +++ b/gnosis.el @@ -227,6 +227,15 @@ Set SPLIT to t to split all input given." (gnosis--delete 'decks `(= name ,deck)) (message "Deleted deck %s" deck)) +(defun gnosis-suspend-deck (&optional deck) + "Suspend all note(s) with DECK id. + +When called with a prefix, unsuspends all notes in deck." + (unless deck (setf deck (gnosis--get-deck-id))) + (let ((notes (gnosis-select 'id 'notes `(= deck-id ,deck))) + (suspend (if current-prefix-arg 0 1))) + (cl-loop for note in notes + do (gnosis-update 'review-log `(= suspend ,suspend) `(= id ,(car note)))))) (defun gnosis-add-note-fields (deck type main options answer extra tags suspend image) "Add fields for new note. -- cgit v1.2.3