diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index d342318..5077d3e 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -86,4 +86,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ghc-kill-process () + (interactive) + (let* ((name ghc-process-process-name) + (cpro (if name (get-process name)))) + (if (not cpro) + (message "No process") + (delete-process cpro) + (message "A process was killed")))) + (provide 'ghc-process) diff --git a/elisp/ghc.el b/elisp/ghc.el index b0b612e..e0a94e9 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -50,6 +50,7 @@ (defvar ghc-toggle-key "\C-c\C-c") (defvar ghc-module-key "\C-c\C-m") (defvar ghc-expand-key "\C-c\C-e") +(defvar ghc-kill-key "\C-c\C-k") (defvar ghc-hoogle-key (format "\C-c%c" (ghc-find-C-h))) (defvar ghc-shallower-key "\C-c<") (defvar ghc-deeper-key "\C-c>") @@ -80,6 +81,7 @@ (define-key haskell-mode-map ghc-check-key 'ghc-save-buffer) (define-key haskell-mode-map ghc-toggle-key 'ghc-toggle-check-command) (define-key haskell-mode-map ghc-module-key 'ghc-insert-module) + (define-key haskell-mode-map ghc-kill-key 'ghc-kill-process) (define-key haskell-mode-map ghc-hoogle-key 'haskell-hoogle) (define-key haskell-mode-map ghc-shallower-key 'ghc-make-indent-shallower) (define-key haskell-mode-map ghc-deeper-key 'ghc-make-indent-deeper)