diff options
| author | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-14 20:21:23 +0100 |
|---|---|---|
| committer | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-14 22:07:18 +0100 |
| commit | fd3efa233ecea038c8a38e4cd229398128271c8a (patch) | |
| tree | 62cae4c9e468aa27b7d2224c696ee2268d306d53 /robot/org-drill-launch.el | |
| parent | 644b0a5cbce87c7d159d5c6bcee537bce9a40567 (diff) | |
| download | org-drill-fd3efa233ecea038c8a38e4cd229398128271c8a.tar.gz org-drill-fd3efa233ecea038c8a38e4cd229398128271c8a.zip | |
Port to cl-lib
Diffstat (limited to 'robot/org-drill-launch.el')
| -rw-r--r-- | robot/org-drill-launch.el | 37 |
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) |
