Skip to content

Commit

Permalink
dante-exec
Browse files Browse the repository at this point in the history
  • Loading branch information
jyp committed Oct 16, 2022
1 parent f24f472 commit f90242d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dante.el
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ if the argument is omitted or nil or a positive integer).
(define-key dante-mode-map (kbd "C-c ,") 'dante-info)
(define-key dante-mode-map (kbd "C-c /") 'attrap-attrap) ;; deprecated keybinding
(define-key dante-mode-map (kbd "C-c \"") 'dante-eval-block)
(define-key dante-mode-map (kbd "C-c C-c") 'dante-exec)

;;;;;;;;;;;;;;;;;;;;;;;;;
;; Interactive utils
Expand Down Expand Up @@ -871,6 +872,15 @@ The command block is indicated by the >>> symbol."
(not (looking-at "[ \t]*--[ \t]+>>>")))
(forward-line)))))))

(defcustom dante-exec-default "main"
(substitute-command-keys "Default command to run by `dante-exec'.")
:group 'dante :safe t :type 'string)

(defun dante-exec (command)
"Execute COMMAND in GHCi and show the result in the echo area."
(interactive (list dante-exec-default))
(lcr-spawn (message "%s" (lcr-call dante-async-call command))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Flymake

Expand Down

0 comments on commit f90242d

Please sign in to comment.