Skip to content
Browse files

Merge pull request #122 from fmap/master

Adding options for ghc-core-create-core
  • Loading branch information...
2 parents 3b36276 + 4301e6a commit 7f885ccf29bf35d7b0f546eb25669565dd3911bb @gregorycollins gregorycollins committed Feb 11, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 ghc-core.el
8 ghc-core.el
@@ -35,7 +35,7 @@
"Remove commonly ignored annotations and namespace
prefixes in the given region."
(interactive "r")
- (save-restriction
+ (save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(while (search-forward-regexp "GHC\.[^\.]*\." nil t)
@@ -57,6 +57,9 @@ prefixes in the current buffer."
(ghc-core-clean-region (point-min) (point-max)))
+(defvar ghc-core-create-options '("-O2")
+ "Options that will be passed to ghc when generating core output.")
(defun ghc-core-create-core ()
"Compiled and load the current buffer as tidy core"
@@ -65,7 +68,8 @@ prefixes in the current buffer."
(let ((core-buffer (generate-new-buffer "ghc-core"))
(neh (lambda () (kill-buffer core-buffer))))
(add-hook 'next-error-hook neh)
- (call-process "ghc" nil core-buffer nil "-c" "-ddump-simpl" "-O2" (buffer-file-name))
+ (apply 'call-process "ghc" nil core-buffer nil "-c" "-ddump-simpl"
+ (buffer-file-name) ghc-core-create-options)
(display-buffer core-buffer)
(with-current-buffer core-buffer

0 comments on commit 7f885cc

Please sign in to comment.
Something went wrong with that request. Please try again.