Skip to content

Use haskell-check-command for flymake-init #385

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

Closed
wants to merge 3 commits into from

Conversation

andrewsw
Copy link

Instead of the default nil of haskell-saved-check-command, uses
haskell-check-command to ensure we have something reasonable to run.

Fixes #384

Instead of the default nil of haskell-saved-check-command, uses
haskell-check-command to ensure we have something reasonable to run.
@purcell
Copy link
Member

purcell commented Dec 1, 2014

Great, but this isn't just the default: I think we'd want something like (or haskell-saved-check-command haskell-check-command) so that the user's command takes precedence once set. Could you amend this PR accordingly?

P.S. Also look into Flycheck if you haven't already. It renders flymake obsolete. :-)

@andrewsw
Copy link
Author

andrewsw commented Dec 4, 2014

I experimented with your proposed change and it doesn't necessarily work the way one would expect.

haskell-saved-check-command will be set by use of haskell-check, which is great, but haskell-check doesn't infer the file name. So to use haskell-check, you have to provide not only the command to run, but also it's arguments and the target file name which is all stored in haskell-saved-check-command. This is great for obvious reasons, when using haskell-check, but not so good for flymake because flymake assumes it only has the checking command and not the target -- constructing the target temporary file and appending it's name to the end of the command.

In the end, either there has to be a lot more machinery in place to make fuzzy attempts at removing the target filename from haskell-saved-check-command when using it in flymake, or do something completely different. How about I make another variable... haskell-flymake-check-command to disambiguate the uses?

And yes, I'll investigate flycheck at some point. If flymake is obsolete, maybe it should be removed from haskell-mode?

Andrew Sackville-West added 2 commits December 3, 2014 18:15
the semantics of haskell-check-command and haskell-saved-check-command
aren't really correct for this usage
@andrewsw
Copy link
Author

andrewsw commented Dec 4, 2014

updated with my suggestion.

@purcell
Copy link
Member

purcell commented Dec 4, 2014

If flymake is obsolete, maybe it should be removed from haskell-mode?

Yes, possibly, though flycheck doesn't work with Emacs 23, which haskell-mode still nominally supports.

@chrisdone
Copy link
Member

If it's of interest I'm going to add flycheck support to haskell-interactive-mode this weekend, after merging in #381.

@purcell
Copy link
Member

purcell commented Dec 4, 2014

I'm going to add flycheck support to haskell-interactive-mode this weekend

How will that work? You mean the interactive expressions will get flychecked as they are typed?

@chrisdone
Copy link
Member

I mean checking files using the haskell-process module.

@purcell
Copy link
Member

purcell commented Dec 4, 2014

Aha, so that will be a custom flycheck checker which hooks into the haskell-process machinery? Sounds like it could be a nice alternative to the flycheck-haskell code.

Presumably this would then live in a separate repo and be a package which would depend on both haskell-mode and flycheck?

@chrisdone
Copy link
Member

Yeah, probably.

@gracjan
Copy link
Contributor

gracjan commented Feb 17, 2015

@chrisdone ? @purcell ? Can/should this pull by @andrewsw be merged?

@purcell
Copy link
Member

purcell commented Feb 17, 2015

Not in its current form, I'd say. This change removes haskell-saved-check-command from the picture, but that var is still set from elsewhere, and some people will likely be accustomed to running the checker explicitly first in order to set it.

I'd suggest that when running the check manually, the default command should be taken from this new haskell-flymake-check-command variable, and that haskell-saved-check-command should still be used (if set) as the flymake command.

@gracjan
Copy link
Contributor

gracjan commented Mar 4, 2015

@andrewsw: Are you able to change your commit so that it conforms to what @purcell says?

@andrewsw-janrain
Copy link

@gracjan , yes probably. Sorry, I've been heavily distracted at work and hadn't gotten back to it. I'll try this weekend, but won't object if someone beats me to it.

@gracjan
Copy link
Contributor

gracjan commented Sep 28, 2015

It seems that this one is stalled. If anybody finds time to push this forward do no hesitate to reopen or create a new pull request.

@gracjan gracjan closed this Sep 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

Successfully merging this pull request may close these issues.

flymake-init uses nil haskell-saved-check-command
5 participants