     (define-key map [backspace]   'backward-delete-char-untabify))
 
   ;; And add some of my own
-  (local-set-key (kbd "C-c C-a") 'pjones:haskell-new-import)
-  (local-set-key (kbd "C-c C-s") 'pjones:haskell-sort-imports)
-  (local-set-key (kbd "C-c C-v") 'pjones:haskell-lint-all)
-  (local-set-key (kbd "C-c M-m") 'pjones:haskell-new-module)
-  (local-set-key (kbd "C-c M-w") 'pjones:haskell-module-name-to-kill-ring)
-  (local-set-key (kbd "M-RET")   'pjones:haskell-smart-newline)
+  (let ((map haskell-mode-map))
+    (define-key map (kbd "C-c C-a") 'pjones:haskell-new-import)
+    (define-key map (kbd "C-c C-e") 'pjones:haskell-edit-cabal-file)
+    (define-key map (kbd "C-c C-s") 'pjones:haskell-sort-imports)
+    (define-key map (kbd "C-c C-v") 'pjones:haskell-lint-all)
+    (define-key map (kbd "C-c M-m") 'pjones:haskell-new-module)
+    (define-key map (kbd "C-c M-w") 'pjones:haskell-module-name-to-kill-ring)
+    (define-key map (kbd "M-RET")   'pjones:haskell-smart-newline))
 
   (make-local-variable 'tab-always-indent)
   (setq tab-always-indent t

        end-of-defun-function 'pjones:haskell-end-of-defun))

(add-hook 'haskell-mode-hook 'pjones:haskell-mode-hook)
(add-hook 'haskell-cabal-mode-hook 'pjones:prog-mode-hook)
(add-hook 'haskell-mode-hook 'haskell-indentation)

;; Local Variables:
;; byte-compile-warnings: (not noruntime)


(defun pjones:haskell-module-name ()
  "Return the module name for the current buffer."
  (let* ((cabal-path (file-name-directory (pjones:haskell-find-cabal-file)))
         (mod-path   (substring (file-name-sans-extension (buffer-file-name))
                                (length cabal-path)))
         (mod-name   (replace-regexp-in-string "/" "." mod-path t t)))
