aboutsummaryrefslogtreecommitdiff
path: root/robot/robot.el
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2020-04-12 18:11:20 +0000
committerPhillip Lord <phillip.lord@russet.org.uk>2020-04-12 18:11:20 +0000
commitb05f06a4b15bffffdcaeb1a30482afd94c12746a (patch)
tree691f7c78eb21906a03bdc3896c4bc719930d7a3f /robot/robot.el
parent0c89f344ce019e03df278578414617b74034031b (diff)
parentec2c168797380c7e41c13a9260c79139bed3300c (diff)
downloadorg-drill-b05f06a4b15bffffdcaeb1a30482afd94c12746a.tar.gz
org-drill-b05f06a4b15bffffdcaeb1a30482afd94c12746a.zip
Merge branch 'branweb/fix-cram-mode' into 'master'
Allow Creating New Session in Cram Mode See merge request phillord/org-drill!9
Diffstat (limited to 'robot/robot.el')
-rw-r--r--robot/robot.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/robot/robot.el b/robot/robot.el
index f7053b8..3d965b0 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)