Created
March 18, 2024 16:11
-
-
Save smoge/c2ea8597cb37af9b1f56aea65ea33976 to your computer and use it in GitHub Desktop.
haskell-interactive-ext.el
This file contains 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
(require 'haskell-interactive-mode) | |
;; add to .ghci | |
;; :set +m | |
(defun haskell-interactive-my-eval () | |
"Evaluate the current line or region in the Haskell REPL." | |
(interactive) | |
(if (use-region-p) | |
(progn | |
(kill-ring-save (region-beginning) (region-end)) | |
(pulse-momentary-highlight-region (region-beginning) (region-end)) | |
(haskell-interactive-switch) | |
(yank) | |
(haskell-interactive-mode-return) | |
(haskell-interactive-switch-back)) | |
(progn | |
(kill-ring-save (line-beginning-position) (line-end-position)) | |
(pulse-momentary-highlight-region (line-beginning-position) (line-end-position)) | |
(haskell-interactive-switch) | |
(yank) | |
(haskell-interactive-mode-return) | |
(haskell-interactive-switch-back)))) | |
(define-key haskell-mode-map (kbd "S-<return>") 'haskell-interactive-my-eval) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment