aboutsummaryrefslogtreecommitdiff
path: root/robot
diff options
context:
space:
mode:
Diffstat (limited to 'robot')
-rw-r--r--robot/org-drill-launch.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/robot/org-drill-launch.el b/robot/org-drill-launch.el
index a5c6219..85f23ff 100644
--- a/robot/org-drill-launch.el
+++ b/robot/org-drill-launch.el
@@ -2,29 +2,30 @@
(setq make-backup-files nil)
(setq auto-save-default nil)
+(setq top-dir default-directory)
+
;; Clean up
-(delete-file "./robot/failure.txt")
+(delete-file (concat top-dir "robot/failure.txt"))
(set-frame-name "emacs-bot")
-(condition-case e
- (load-file "org-drill.el")
- (error
- (with-temp-buffer
- (insert (format "%s" (error-message-string e)))
- (write-region (point-min) (point-max) "./robot/failure.txt"))
- (let ((kill-emacs-hook nil))
- (kill-emacs))))
+(setq debug-on-error t)
+(setq debug-on-quit t)
+
+(add-hook 'debugger-mode-hook
+ 'org-drill-launcher-dump-in-a-bit)
+(defun org-drill-launcher-dump-in-a-bit ()
+ (run-with-timer 1 nil #'org-drill-launcher-dump))
+
+(defun org-drill-launcher-dump ()
+ (save-excursion
+ (set-buffer "*Backtrace*")
+ (write-region (point-min) (point-max) (concat top-dir "robot/failure.txt")))
+ (kill-emacs))
+
+(load-file "org-drill.el")
(copy-file "robot/main-test.org" "robot/main-test-copy.org" t)
(find-file "robot/main-test-copy.org")
-(condition-case e
- (org-drill)
- (error
- (with-temp-buffer
- (insert (format "%s" (error-message-string e)))
- ;; write to ./ now because we have changed directory
- (write-region (point-min) (point-max) "./failure.txt"))
- (let ((kill-emacs-hook nil))
- (kill-emacs))))
+(org-drill)