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

PowerShell hangs on haskell-process-generate-tags #609

Closed
ibraimgm opened this issue Apr 27, 2015 · 8 comments
Closed

PowerShell hangs on haskell-process-generate-tags #609

ibraimgm opened this issue Apr 27, 2015 · 8 comments

Comments

@ibraimgm
Copy link

Hello! I recently updated haskell-mode and noticed that the tag generation (when I save/reload a file) gets "locked" into powershell. I don't know why, bu when the current command is run inside emacs:

 (format ":!powershell -Command \"& { cd %s ; hasktags -e -x (ls -fi *.hs -exclude \\\"#*#\\\" -name -r) ; exit }\""
                            (haskell-session-cabal-dir
                              (haskell-process-session (car state))))

Everything just freezes. The equivalent command, in the shell itself, does not hang.
Why we must do this with powershell? Is there a specific reason to not use hasktags directly?
On my configuration, I changed the above line with:

(format ":!hasktags --output=%s\\TAGS -x -e %s"
                            (haskell-session-cabal-dir (haskell-process-session (car state)))
                            (haskell-session-cabal-dir (haskell-process-session (car state))))

And the result looks the same to me (it's even recursive).
If the above solution is acceptable, I can send a patch/pull request later.

Related:
#49
#447

@gracjan
Copy link
Contributor

gracjan commented Apr 27, 2015 via email

@ibraimgm
Copy link
Author

Good catch. I will try this tomorrow and make a pull request if it works.

@TimoFreiberg
Copy link
Contributor

I had the same problem, the powershell command caused an error. It also caused the exact same error if I typed the command in the powershell myself, though. Maybe it depends on the system environment?
Anyway, I replaced the command with the second snippet (which just uses hasktags) in my haskell-commands.el and the REPL no longer hangs.

Paths with spaces don't work ("warning: no files found!"), but I could fix this by escaping the paths with quotes.
Current working version:

                 (format ":!hasktags --output=\"%s\\TAGS\" -x -e \"%s\""
                            (haskell-session-cabal-dir (haskell-process-session (car state)))
                            (haskell-session-cabal-dir (haskell-process-session (car state)))))

The escaping is kind of a hack of course, but I'm way too much of a newbie in Emacs and LISP to try a more elegant solution.

I only just noticed because I don't have to restart the process all the time anymore: Is it correct that files aren't automatically loaded into the REPL when saved? Or am I doing something wrong?

@gracjan
Copy link
Contributor

gracjan commented Apr 28, 2015 via email

@ibraimgm
Copy link
Author

@TimoFreiberg , looks like you're faster than me 👍

Anyway, about your question:

Is it correct that files aren't automatically loaded into the REPL when saved? Or am I doing something wrong?

You have to cal haskell-process-load-file to reload the file on teh REPL (I bound it to C-c C-l). If you want to reload when you save, you might need to create a hook in after-save-hook or something like that.

@gracjan
Copy link
Contributor

gracjan commented Apr 28, 2015

Wait, where is the pull request?

@TimoFreiberg
Copy link
Contributor

Recreated it, I thought I did something wrong before.

@gracjan
Copy link
Contributor

gracjan commented Apr 28, 2015

Now it works. Thanks!

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

No branches or pull requests

3 participants