summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--org-fc-core.el15
-rw-r--r--org-fc-review.el7
2 files changed, 13 insertions, 9 deletions
diff --git a/org-fc-core.el b/org-fc-core.el
index 50d34f4..1033cf1 100644
--- a/org-fc-core.el
+++ b/org-fc-core.el
@@ -31,6 +31,7 @@
(require 'org-element)
(require 'subr-x)
+(require 'cl)
;;; Customization
@@ -480,10 +481,20 @@ Other useful values are:
;;;###autoload
(defun org-fc-suspend-card ()
- "Suspend the headline at point if it is a flashcard."
+ "Suspend the headline at point if it is a flashcard.
+If there is an active review session, all positions of
+the now suspended card are removed from it."
(interactive)
(org-fc-with-point-at-entry
- (org-fc--add-tag org-fc-suspended-tag)))
+ (org-fc--add-tag org-fc-suspended-tag)
+
+ (when org-fc-review--session
+ (let ((id (org-id-get)))
+ (with-slots (cards) org-fc-review--session
+ (setf cards
+ (cl-remove-if
+ (lambda (card)
+ (string= id (plist-get card :id))) cards)))))))
;;;###autoload
(defun org-fc-suspend-tree ()
diff --git a/org-fc-review.el b/org-fc-review.el
index d539439..eaa29cf 100644
--- a/org-fc-review.el
+++ b/org-fc-review.el
@@ -268,13 +268,6 @@ same ID as the current card in the session."
"Suspend card and proceed to next."
(interactive)
(org-fc-suspend-card)
- ;; Remove all other positions from review session
- (with-slots (current-item cards) org-fc-review--session
- (let ((id (plist-get current-item :id)))
- (setf cards
- (cl-remove-if
- (lambda (card)
- (string= id (plist-get card :id))) cards))))
(org-fc-review-reset)
(org-fc-review-next-card))