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

Stylish haskell doesn't work in haskell-mode any more #116

Closed
Mikolaj opened this issue Jan 27, 2013 · 10 comments
Closed

Stylish haskell doesn't work in haskell-mode any more #116

Mikolaj opened this issue Jan 27, 2013 · 10 comments

Comments

@Mikolaj
Copy link
Member

Mikolaj commented Jan 27, 2013

Others can't reproduce this, so it may be due to my emacs version (GNU Emacs 23.3.1, Ubuntu 12.04.1 LTS) or the cruft in my emacs configuration:

https://github.com/Mikolaj/mydotflies/blob/master/.emacs

Perhaps somebody else has a similar problem?

I can run stylish-haskell all right from command line, but it does not seem to have any effect anymore from haskell-mode. The commit that causes the behaviour is the last of the series that fixed many problems of stylish-haskell in haskell-mode

11b531c

With this commit, it apparently saves some extra stuff when I change and save the file:

Saving file /mikolaj/r/LambdaHack/Game/LambdaHack/Kind.hs...
Wrote /mikolaj/r/LambdaHack/Game/LambdaHack/Kind.hs [2 times]
Tags generated.

but the file is not affected apart of my original change.
For comparison, when I set

'(haskell-stylish-on-save nil)

I'm getting

Saving file /mikolaj/r/LambdaHack/Game/LambdaHack/Kind.hs...
Wrote /mikolaj/r/LambdaHack/Game/LambdaHack/Kind.hs
(No changes need to be saved)
Tags generated.
@Mikolaj
Copy link
Member Author

Mikolaj commented Jan 27, 2013

It does not seem to be the fault of my emacs configuration, since it happens also with the following .emacs:

(custom-set-variables
 '(haskell-indentation-where-post-offset 1)
 '(haskell-interactive-mode-hide-multi-line-errors nil)
 '(haskell-process-prompt-restart-on-cabal-change nil)
 '(haskell-process-suggest-remove-import-lines nil)
 '(haskell-stylish-on-save t)
 '(haskell-tags-on-save t))
(load "~/r/haskell-mode/haskell-site-file")
(require 'cl)

@gregorycollins
Copy link
Member

I can confirm this bug now -- my other laptop has Emacs 23.3.1 and exhibits the bad behaviour. You can see the error (which gets swallowed by the save hook) by running M-x haskell-mode-stylish-buffer.

@ghost ghost assigned chrisdone Jan 29, 2013
@gregorycollins
Copy link
Member

Bah, the call-process feature we're using was introduced in emacs 24. I'll fix :-(

@Mikolaj
Copy link
Member Author

Mikolaj commented Jan 30, 2013

Bah, I've just upgraded to a backport of emacs 24. :D

@nrolland
Copy link

there is still a weird issue, as when haskell-stylish-on-save is enabled, the TAGS file supposed to be coming from haskell-tags-on-save is not actually generated

@ivan-m
Copy link
Contributor

ivan-m commented Apr 17, 2015

@nrolland maybe open a new issue for this as this one is labelled as being closed?

@Mikolaj
Copy link
Member Author

Mikolaj commented Apr 17, 2015

there is still a weird issue, as when haskell-stylish-on-save is enabled, the TAGS file supposed to be coming from haskell-tags-on-save is not actually generated

I can't reproduce that with GNU Emacs 24.3.1 and haskell-mode from 2013-11-09 21:44:26 (doh, am I lazy with updating!).

@gracjan
Copy link
Contributor

gracjan commented Apr 18, 2015

@nrolland: Thanks for reporting. We will need a reproducible case to debug this.

Also a new open issue would be a good idea so that new information is not lost.

@nrolland
Copy link

@gracjan I ma not sure what is the best way to have a reproducible case.

@Mikolaj : are you sure the file is actually generated ? I have the emacs display that tags have been generated but no file appears.
Very oddly enough, when calling directly M-x haskell-process-generate-tags, the file does get generated. FWIW, I tried to trace the calls down to haskell-process.el : (defun haskell-process-send-string (process string) but I dont see any difference in the string being sent when triggered on save VS manually invoked, which is puzzling...

":!cd /Users/nrolland/notes/utrecht/lab22/ && find . -name '.hs' -print0 -or -name '.lhs' -print0 -or -name '*.hsc' -print0 | xargs -0 hasktags -e -x
"

":!cd /Users/nrolland/notes/utrecht/lab22/ && find . -name '.hs' -print0 -or -name '.lhs' -print0 -or -name '*.hsc' -print0 | xargs -0 hasktags -e -x
"

invoking that command from cabal real does generate the tags.

@Mikolaj
Copy link
Member Author

Mikolaj commented Jul 23, 2015

@nrolland: yes, the TAGS are automatically generated for me (but note I no longer have access to the old configuration from the time I reported the bug and with the new setup I see no erroneous behariour). Cheers!

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

6 participants