summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-06 20:36:10 +0300
committerThanos Apollo <[email protected]>2024-08-06 20:36:27 +0300
commit2a41bcba72847481584f118a9b1a4b1862d3bb31 (patch)
tree6d6922f477e4cd41c6d00fb2a49419c6c9beb2fa
parentdee5ed194c45de6a8c376c28f1b7728cbe1d0982 (diff)
suspend-note: Add verification optional arg.
* Optionally, skin verification y-or-n-p promtp.
-rw-r--r--gnosis.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/gnosis.el b/gnosis.el
index ab46e26..3e0049a 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -721,10 +721,13 @@ If NAME is t, return name of deck."
(deck (gnosis-get 'deck-id 'notes id-clause)))
(if name (gnosis--get-deck-name deck) deck)))
-(cl-defun gnosis-suspend-note (id)
- "Suspend note with ID."
- (let ((suspended (= (gnosis-get 'suspend 'review-log `(= id ,id)) 1)))
- (when (y-or-n-p (if suspended "Unsuspend note? " "Suspend note? "))
+(cl-defun gnosis-suspend-note (id &optional verification)
+ "Suspend note with ID.
+
+When VERIFICATION is non-nil, skips `y-or-n-p' prompt."
+ (let* ((suspended (= (gnosis-get 'suspend 'review-log `(= id ,id)) 1))
+ (verification (or verification (y-or-n-p (if suspended "Unsuspend note? " "Suspend note? ")))))
+ (when verification
(if suspended
(gnosis-update 'review-log '(= suspend 0) `(= id ,id))
(gnosis-update 'review-log '(= suspend 1) `(= id ,id))))))