aboutsummaryrefslogtreecommitdiff
path: root/robot/robot.el
diff options
context:
space:
mode:
authorBrandon Webster <brandon.webster@socrata.com>2020-04-12 09:17:58 -0700
committerBrandon Webster <brandon.webster@socrata.com>2020-04-12 09:17:58 -0700
commit9e337363f6dc11ff560a618336f31d03e15aebf4 (patch)
tree6009477d293b96e754a5a79a216f7d8ba9b95917 /robot/robot.el
parent28b8f731cb3edc982ab5f31ae772e8754ad6bbab (diff)
downloadorg-drill-9e337363f6dc11ff560a618336f31d03e15aebf4.tar.gz
org-drill-9e337363f6dc11ff560a618336f31d03e15aebf4.zip
add helper fn to check cards without killing emacs
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)