Skip to content

Commit 8ab625e

Browse files
committed
add function: C-c RET loads & runs current buffer
Alternatively, C-c C-m can be used.
1 parent 495fb96 commit 8ab625e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

haskell.el

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
(defvar interactive-haskell-mode-map
3939
(let ((map (make-sparse-keymap)))
4040
(define-key map (kbd "C-c C-l") 'haskell-process-load-file)
41+
(define-key map (kbd "C-c RET") 'haskell-load-and-run) ;; == C-c C-m
4142
(define-key map (kbd "C-c C-r") 'haskell-process-reload)
4243
(define-key map (kbd "C-c C-t") 'haskell-process-do-type)
4344
(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
397398
nil
398399
(current-buffer)))
399400

401+
(defun haskell-load-and-run ()
402+
"Loads the current buffer and runs the main function."
403+
(interactive)
404+
(haskell-process-load-file)
405+
(haskell-interactive-mode-run-expr "main"))
406+
400407
;;;###autoload
401408
(defun haskell-process-reload ()
402409
"Re-load the current buffer file."

0 commit comments

Comments
 (0)