branch: elpa/haskell-mode commit 8ab625efe94aeffeb9e6427cb0af5329c52ab389 Author: Zaz Brown <zazbr...@zazbrown.com> Commit: Zaz Brown <zazbr...@zazbrown.com>
add function: C-c RET loads & runs current buffer Alternatively, C-c C-m can be used. --- haskell.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/haskell.el b/haskell.el index 1b358051c9..3bb546b8df 100644 --- a/haskell.el +++ b/haskell.el @@ -38,6 +38,7 @@ (defvar interactive-haskell-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-l") 'haskell-process-load-file) + (define-key map (kbd "C-c RET") 'haskell-load-and-run) ;; == C-c C-m (define-key map (kbd "C-c C-r") 'haskell-process-reload) (define-key map (kbd "C-c C-t") 'haskell-process-do-type) (define-key map (kbd "C-c C-i") 'haskell-process-do-info) @@ -397,6 +398,12 @@ Give optional NEXT-P parameter to override value of nil (current-buffer))) +(defun haskell-load-and-run () + "Loads the current buffer and runs the main function." + (interactive) + (haskell-process-load-file) + (haskell-interactive-mode-run-expr "main")) + ;;;###autoload (defun haskell-process-reload () "Re-load the current buffer file."