Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger support #32

Closed
warrenharris opened this issue Apr 26, 2012 · 13 comments
Closed

Debugger support #32

warrenharris opened this issue Apr 26, 2012 · 13 comments

Comments

@warrenharris
Copy link

I'd like to see haskell-mode support better integration with the ghci debugger -- mode key bindings for stepping, tracing, printing, etc, and highlighting of the current source location in the source buffer.

@chrisdone
Copy link
Member

In inf-haskell or haskell-interactive-mode?

@warrenharris
Copy link
Author

inf-haskell might make more sense, if you think of the inferior ghci process as analogous to running gdb in emacs. I guess I care most about highlighting source file locations as stepping occurs, more than key bindings for those commands.

On Apr 26, 2012, at 1:19 PM, Chris Done wrote:

In inf-haskell or haskell-interactive-mode?


Reply to this email directly or view it on GitHub:
#32 (comment)

@chrisdone
Copy link
Member

I meant the new interactive mode or the inf-haskell mode. I maintain the new one, not the old one. I've already done debugger stepping while playing around, it's not a big deal to add support to highlight source locations and step.

Otherwise maybe someone else will implement such support for inf-haskell.

@warrenharris
Copy link
Author

Ah... I thought you took over development of the old one, and I'm just not on the latest version yet. I will switch over to yours and give it a try. I'd be happy to test any source highlighting features you add. Thanks,

Warren

On Apr 26, 2012, at 1:32 PM, Chris Done wrote:

I meant the new interactive mode or the inf-haskell mode. I maintain the new one, not the old one. I've already done debugger stepping while playing around, it's not a big deal to add support to highlight source locations and step.


Reply to this email directly or view it on GitHub:
#32 (comment)

@warrenharris
Copy link
Author

Hi Chris,

I'm trying your new haskell-mode now with GNU Emacs 24.0.95.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2012-04-02 on bob.porkrind.org -- so good so far! One minor bug I've seen though: The first time I C-c C-l a buffer, I get a message saying "No buffer named /Users/warrenharris/....cabal" even though I do have a buffer with that name opened. The second C-c C-l has no problem finding it. It seems to happen with every new .hs file I open/eval.

I'm excited to try out some of your new features. I guess I'll have to watch that video again. :-)

Warren

On Apr 26, 2012, at 1:54 PM, Warren Harris wrote:

Ah... I thought you took over development of the old one, and I'm just not on the latest version yet. I will switch over to yours and give it a try. I'd be happy to test any source highlighting features you add. Thanks,

Warren

On Apr 26, 2012, at 1:32 PM, Chris Done wrote:

I meant the new interactive mode or the inf-haskell mode. I maintain the new one, not the old one. I've already done debugger stepping while playing around, it's not a big deal to add support to highlight source locations and step.


Reply to this email directly or view it on GitHub:
#32 (comment)

@chrisdone
Copy link
Member

I think C-c C-l is the old inf-haskell binding. Other people have had this problem, you have to rebind it to my stuff.

@warrenharris
Copy link
Author

On Apr 26, 2012, at 11:41 PM, Chris Done wrote:

I think C-c C-l is the old inf-haskell binding. Other people have had this problem, you have to rebind it to my stuff.

I'm not sure I understand. I removed my old haskell-mode and then followed the instructions on your github site to install your new stuff. What else do I have to do to enable it?

Warren

@chrisdone
Copy link
Member

What does C-h k C-c C-l give in a Haskell buffer?

@warrenharris
Copy link
Author

Something must be very wrong. C-h is the same as Delete on my system. (backward-delete-char-untabify)

I see in the instructions that it says "A new mode for the REPL and GHCi sessions is called haskell-interactive-mode..." I had assumed that this would be in effect simply by loading the new haskell-site-file.el. When I try to set this mode with M-x haskell-interactive-mode, I get an error:

Wrong number of arguments: (lambda (session) "Interactive mode for Haskell." (interactive) (kill-all-local-variables) (haskell-session-assign session) (use-local-map haskell-interactive-mode-map) (set (make-local-variable (quote haskell-interactive-mode)) t) (setq major-mode (quote haskell-interactive-mode)) (setq mode-name "Interactive-Haskell") ...), 0

Here's my .emacs setup:

(load "~/.emacs.d/site-lisp/haskell-interactive-mode/haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
(add-hook 'haskell-mode-hook 'font-lock-mode)

(setq haskell-program-name "/usr/local/bin/ghci") ; couldn't seem to find this from my path

(add-hook 'haskell-mode-hook
(lambda()
(add-hook 'before-save-hook
'delete-trailing-whitespace nil t)))

Thanks for any help you can provide,

Warren

On Apr 28, 2012, at 3:05 AM, Chris Done wrote:

What does C-h k C-c C-l give?


Reply to this email directly or view it on GitHub:
#32 (comment)

@chrisdone
Copy link
Member

I assume haskell-interactive-mode/haskell-site-file is the haskell-site-file from the normal haskell-mode repo. You also need to load examples/init.el which will rebind some stuff for the new one. Try that and then C-c C-l should be rebound to haskell-process-load-file.

C-h as delete is, uh, crazy. Your system is definitely odd.

@warrenharris
Copy link
Author

Ok, I found the C-h binding in my 20+ yr old .emacs file. :-) Now I can tell you that C-h k C-c C-l says this:

C-c C-l runs the command inferior-haskell-load-file, which is an
interactive Lisp function in `inf-haskell.el'.

It is bound to C-c C-l, .

(inferior-haskell-load-file &optional RELOAD)

Pass the current buffer's file to the inferior haskell process.
If prefix arg C-u is given, just reload the previous file.

I also loaded your example/init.el file and the binding for C-c C-l is the same. Turns out that this has to be done before the haskell-mode-hook triggers. Your instructions didn't actually say that you need to load examples/init.el to get the new stuff to work. Since it was just "examples" I ignored it.

After fixing this problem (and getting C-c C-l set to haskell-process-load-file) I see that C-c C-l doesn't work without cabal-dev. It would be nice if there was an option to run it with standard cabal. I tried setting haskell-process-path-cabal-dev, but no-go. The README should say you need this too. I'll install it and try again later.

Sorry if I expect this to be a drop-in replacement for the old haskell-mode. I see now that it takes some tweaking.

Warren

On Apr 28, 2012, at 11:40 AM, Chris Done wrote:

I assume haskell-interactive-mode/haskell-site-file is the haskell-site-file from the normal haskell-mode repo. You also need to load examples/init.el which will rebind some stuff for the new one. Try that and then C-c C-l should be rebound to haskell-process-load-file.

C-h as delete is, uh, crazy. Your system is definitely odd.


Reply to this email directly or view it on GitHub:
#32 (comment)

@chrisdone
Copy link
Member

From the docs:

To make use of them, try out the instructions in examples/init.el. WARNING: The features expressed in here are new and many are Linux-specific.

Note: These features are entirely orthogonal to the older inferior-haskell-mode, and therefore keybindings which work for inferior-haskell-mode will not magically work for the above new modules.

Set haskell-process-type to 'ghci and it will use normal cabal.

@gracjan gracjan removed the P2: Should label Mar 1, 2015
@gracjan
Copy link
Contributor

gracjan commented Mar 27, 2015

This issue is 3 years old and it seems that haskell-mode has moved forward significantly. Write a note here and we will reopen if you feel this is still up to date.

@gracjan gracjan closed this as completed Mar 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants