branch: elpa/org-drill
commit 2d7ea5d00ba80f7e7a02507b4bd212dbd83991ac
Author: Brandon Webster <[email protected]>
Commit: Brandon Webster <[email protected]>
add helper fn to check cards without killing emacs
---
robot/robot.el | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/robot/robot.el b/robot/robot.el
index f7053b8632..3d965b0e46 100644
--- a/robot/robot.el
+++ b/robot/robot.el
@@ -55,18 +55,25 @@
(run-with-timer 1 1 #'robot-dump-messages)
-(defun robot-check-cards-seen-and-die (n)
+(defun robot-check-cards-seen (n)
+ "N is number of cards we expect to have seen this session.
+Returns a number representing an exit status code"
(if (= n org-drill-cards-in-this-emacs)
(progn
(princ
(format "Succeeded: Saw %s cards as expected\n" n)
'external-debugging-output)
- (kill-emacs 0))
- (princ
- (format "Failed: Saw %s cards, expecting %s\n"
- org-drill-cards-in-this-emacs n)
- 'external-debugging-output)
- (kill-emacs -1)))
+ 0)
+ (progn
+ (princ
+ (format "Failed: Saw %s cards, expecting %s\n"
+ org-drill-cards-in-this-emacs n)
+ 'external-debugging-output)
+ -1)))
+
+(defun robot-check-cards-seen-and-die (n)
+ "N is number of cards we expect to have seen this session."
+ (kill-emacs (robot-check-cards-seen n)))
;; Move the package-user-dir somewhere local
(require 'package)