summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-10 08:46:33 +0200
committerThanos Apollo <[email protected]>2024-01-10 08:46:33 +0200
commitf486d7c9ca080931e096e7b0059313cf5ed0a00b (patch)
tree3347876a51f8867377f6781d4087c0f886bad77f
parent859278628cce072e7ce5cc00d1d7895d926565e0 (diff)
Redo gnosis-suspend-note
Use cl-defun and add optional value for unsuspend, this function should also be used to unsuspend notes
-rw-r--r--gnosis.el9
1 files 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.