From f486d7c9ca080931e096e7b0059313cf5ed0a00b Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 10 Jan 2024 08:46:33 +0200 Subject: Redo gnosis-suspend-note Use cl-defun and add optional value for unsuspend, this function should also be used to unsuspend notes --- gnosis.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnosis.el b/gnosis.el index 6f3c0cc..f462fec 100644 --- a/gnosis.el +++ b/gnosis.el @@ -334,9 +334,12 @@ Set SPLIT to t to split all input given." (gnosis--delete 'decks `(= name ,deck)) (message "Deleted deck %s" deck)) -(defun gnosis-suspend-note (id) - "Suspend note with ID." - (gnosis-update 'review-log '(= suspend 1) `(= id ,id))) +;; 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. -- cgit v1.2.3