emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-drill 2d7ea5d00b 245/251: add helper fn to check cards


From: ELPA Syncer
Subject: [nongnu] elpa/org-drill 2d7ea5d00b 245/251: add helper fn to check cards without killing emacs
Date: Mon, 17 Jan 2022 18:59:22 -0500 (EST)

branch: elpa/org-drill
commit 2d7ea5d00ba80f7e7a02507b4bd212dbd83991ac
Author: Brandon Webster <brandon.webster@socrata.com>
Commit: Brandon Webster <brandon.webster@socrata.com>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]