Skip to content
This repository
Browse code

Merge pull request #122 from fmap/master

Adding options for ghc-core-create-core
  • Loading branch information...
commit 7f885ccf29bf35d7b0f546eb25669565dd3911bb 2 parents 3b36276 + 4301e6a
Gregory Collins gregorycollins authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 2 ghc-core.el
8 ghc-core.el
@@ -35,7 +35,7 @@
35 35 "Remove commonly ignored annotations and namespace
36 36 prefixes in the given region."
37 37 (interactive "r")
38   - (save-restriction
  38 + (save-restriction
39 39 (narrow-to-region start end)
40 40 (goto-char (point-min))
41 41 (while (search-forward-regexp "GHC\.[^\.]*\." nil t)
@@ -57,6 +57,9 @@ prefixes in the current buffer."
57 57 (interactive)
58 58 (ghc-core-clean-region (point-min) (point-max)))
59 59
  60 +(defvar ghc-core-create-options '("-O2")
  61 + "Options that will be passed to ghc when generating core output.")
  62 +
60 63 ;;;###autoload
61 64 (defun ghc-core-create-core ()
62 65 "Compiled and load the current buffer as tidy core"
@@ -65,7 +68,8 @@ prefixes in the current buffer."
65 68 (let ((core-buffer (generate-new-buffer "ghc-core"))
66 69 (neh (lambda () (kill-buffer core-buffer))))
67 70 (add-hook 'next-error-hook neh)
68   - (call-process "ghc" nil core-buffer nil "-c" "-ddump-simpl" "-O2" (buffer-file-name))
  71 + (apply 'call-process "ghc" nil core-buffer nil "-c" "-ddump-simpl"
  72 + (buffer-file-name) ghc-core-create-options)
69 73 (display-buffer core-buffer)
70 74 (with-current-buffer core-buffer
71 75 (ghc-core-mode))

0 comments on commit 7f885cc

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