
Hi, running ghci (instead of hugs) in (GNU-) emacs is quite fun. But a few improvements could even increase the fun: a) adding arguments to the ghci was not well documented. So I appended the following (and a few more paths) to my .gnu-emacs: ;(add-hook 'haskell-mode-hook 'turn-on-haskell-hugs) (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci) (setq haskell-ghci-program-args (append '("-fglasgow-exts") '("-fallow-overlapping-instances") '("-Wall") '("-package data") '("-i.:..") )) b) When an error occurs, the cursor jumps to the first error or warning. That's ok, but sometimes a warning is produced by an imported Module that has no errors and then this file is loaded into the buffer. Usually, I try to avoid all warnings, but I was not able to avoid: Warning: Module `I' is imported, but nothing from it is used (except perhaps to re-export instances visible in `I') Indeed I want to import only instances from `I'. Maybe the warning can be suppressed when I explicitely write "import I()" to indicate that I import nothing except instances. (I don't want to switch off that import warning completely.) c) Can someone supply emacs commands (and keys) to step through all the errors and warnings? Regards Christian

a) adding arguments to the ghci was not well documented. So I appended the following (and a few more paths) to my .gnu-emacs:
;(add-hook 'haskell-mode-hook 'turn-on-haskell-hugs) (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci) (setq haskell-ghci-program-args (append '("-fglasgow-exts") '("-fallow-overlapping-instances") '("-Wall") '("-package data") '("-i.:..") ))
You can also create a .ghci file in your home directory and put: :set -fglasgow-exts :set -fallow-overlapping-instances ... into it. ghci will read this when run. sorry, but i can't help with the other two things...

Christian Maeder
a) adding arguments to the ghci was not well documented.
You can add these options to your ~/.ghci file instead, the GHC docs give detailed info.
c) Can someone supply emacs commands (and keys) to step through all the errors and warnings?
In emacs, I've set F12 to "save this file and compile" and I use buffer local variables at the very end of my file for one-button testing: Local Variables: compile-command: "./quickcheck +names ProtoQuickCheck.lhs" End: C-x ` is "jump to next compile error" which can be used to navigate through errors produced from tests (depending on the error format). Also, haskell-mode has several useful extensions like fume that aren't immediately obvious before reading the docs or using C-h m (or C-h b). -- Shae Matijs Erisson - 2 days older than RFC0226 #haskell on irc.freenode.net - We Put the Funk in Funktion

Thanks for the ~/.ghci hint.
In emacs, I've set F12 to "save this file and compile" and I use buffer local variables at the very end of my file for one-button testing:
C-c C-l is fine to me.
Local Variables: compile-command: "./quickcheck +names ProtoQuickCheck.lhs" End:
I'm using .hs files. What is quickcheck and the "+names" argument?
C-x ` is "jump to next compile error" which can be used to navigate through errors produced from tests (depending on the error format).
This looks like some work or am I missing some .el files? I'm no ELisp programmer.
Also, haskell-mode has several useful extensions like fume that aren't immediately obvious before reading the docs or using C-h m (or C-h b).
What is "fume"? C-h m did not reveal any surprises to me.I only use the recommended setup: (setq auto-mode-alist (append auto-mode-alist '(("\\.[hg]s$" . haskell-mode) ("\\.hi$" . haskell-mode) ("\\.l[hg]s$" . literate-haskell-mode)))) (autoload 'haskell-mode "haskell-mode" "Major mode for editing Haskell scripts." t) (autoload 'literate-haskell-mode "haskell-mode" "Major mode for editing literate Haskell scripts." t) (add-hook 'haskell-mode-hook 'turn-on-haskell-font-lock) (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan) (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) ;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent) ;(add-hook 'haskell-mode-hook 'turn-on-haskell-hugs) (add-hook 'haskell-mode-hook 'turn-on-haskell-ghci) Christian

Christian Maeder wrote:
C-x ` is "jump to next compile error" which can be used to navigate through errors produced from tests (depending on the error format).
This looks like some work or am I missing some .el files? I'm no ELisp programmer.
This functionality is provided by "compile.el": C-x ` runs `next-error' `next-error' is an interactive compiled Lisp function -- loaded from "compile"
Also, haskell-mode has several useful extensions like fume that aren't immediately obvious before reading the docs or using C-h m (or C-h b).
What is "fume"? C-h m did not reveal any surprises to me.I only use the recommended setup:
AKA "func-menu.el":
`function-menu' is an interactive autoloaded Lisp function
-- autoloads from "func-menu"
--
Glynn Clements
participants (4)
-
Christian Maeder
-
Glynn Clements
-
Hal Daume III
-
Shae Matijs Erisson