branch: elpa/haskell-mode commit 238bb6262218d5eed02ce7a9cec54c07f9c8cad4 Author: Steve Purcell <st...@sanityinc.com> Commit: Zaz Brown <zazbr...@zazbrown.com>
add haskell-load-and-run-expr-history --- haskell.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/haskell.el b/haskell.el index 3bb546b8df..eae8d2b9f8 100644 --- a/haskell.el +++ b/haskell.el @@ -398,11 +398,16 @@ 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) +(defvar haskell-load-and-run-expr-history nil + "History of expressions used in `haskell-load-and-run'.") + +(defun haskell-load-and-run (expr) + "Load the current buffer and run EXPR, e.g. \"main\"." + (interactive (list (read-string "Run expression: " + (car haskell-load-and-run-expr-history) + 'haskell-load-and-run-expr-history))) (haskell-process-load-file) - (haskell-interactive-mode-run-expr "main")) + (haskell-interactive-mode-run-expr expr)) ;;;###autoload (defun haskell-process-reload ()