Last active
December 11, 2015 05:58
-
-
Save koddo/4555655 to your computer and use it in GitHub Desktop.
for Coursera / Programming Languages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; for Coursera / Programming Languages | |
;; in emacs sml-mode: single keystroke for restarting repl and loading current file | |
(require 'cl) | |
(add-hook 'sml-mode-hook | |
(lambda () | |
(define-key sml-mode-map (kbd "C-c C-v") 'my-sml-restart-repl-and-load-current-file) | |
(defun my-sml-restart-repl-and-load-current-file () | |
(interactive) | |
(ignore-errors (with-current-buffer "*sml*" | |
(comint-interrupt-subjob) | |
(comint-send-eof) | |
(let ((some-time 0.1)) | |
(while (process-status (get-process "sml")) | |
(sleep-for some-time))))) | |
(flet ((sml--read-run-cmd () | |
'("sml" "" nil))) ; (command args host) | |
(sml-prog-proc-send-buffer t))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much! :)
If you made any other code snippets for sml please do share.
PS - I am doing this course too right now :)