Skip to content

Turn few customizable options to variables #736

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

Merged
merged 1 commit into from
Jun 21, 2015
Merged

Turn few customizable options to variables #736

merged 1 commit into from
Jun 21, 2015

Conversation

geraldus
Copy link
Contributor

Turn haskell-ghc-supported-extensions and
haskell-ghc-supported-options into variables, move them outside
customize package to haskell-mode one.

Related to #730

@ivan-m
Copy link
Contributor

ivan-m commented Jun 21, 2015

There is a possibility that someone might want these customised as a minimal subset that's supported by a range of GHC values (e.g. starts Emacs with ghc set to 7.10, at some point changes global settings so that /usr/bin/ghc points to 7.8 which has different supported extensions, etc.).

That said, I think the likelihood of this is minimal and unlikely to cause any problems. I thought it should just be mentioned as part of the risk-assessment of changing this behaviour.

@geraldus
Copy link
Contributor Author

@gracjan don't merge this, I want to clarify doc strings a bit.

@ivan-m your statement sounds reasonable. Let me share my thoughts about this. If need to change some of these options I will do it imperatively rather than customizing these vars, because in the latter case my init file will grew up significantly as the list are too long, e.g.

(setq haskell-ghc-supported-extensions (delete "whatever" haskell-ghc-supported-extensions))

Also, currently these vars are only used in completion functions, and I suppose few wrong completions are not critical, as you mentioned already.

What about this: turn these options into vars and define two customizations, e.g. haskell-ghc-supported-extensions-override and haskell-ghc-supported-options-overrides, a lists containing items of form + option or - option. For example if you want to exclude RankNTypes and include OverloadedStrings from/in supported extensions you can customize haskell-ghc-supported-extensions-override to (list "+ RankNTypes" "- OverloadedString"). This is just example, we can provide some nicer way to customize this. I think this is easier to manage for user than a huge default list of values. To take this in account it is possible to write some helper functions, e.g. haskell-get-supported-extensions-list and haskell-get-supported-options-list.

@ivan-m
Copy link
Contributor

ivan-m commented Jun 21, 2015

That makes sense to me.

@geraldus
Copy link
Contributor Author

@gracjan what do you think?
@ivan-m thank you, there is no much feedback on issues currently.

@gracjan
Copy link
Contributor

gracjan commented Jun 21, 2015

The proposed machinery requires a lot of effort that could be spend elsewhere. Just imagine the amount of tests you would need to write to make sure it works as expected and the amount of documentation explaining what is going on.

I'm afraid I will not be able to agree to pull this complexity in for the sake of future haskell-mode contributors that will come after all of us three have moved on.

@geraldus
Copy link
Contributor Author

@gracjan, so if I update doc string will you merge this?

@gracjan
Copy link
Contributor

gracjan commented Jun 21, 2015

Yes.

@geraldus
Copy link
Contributor Author

@gracjan updated

Turn `haskell-ghc-supported-extensions` and
`haskell-ghc-supported-options` into variable, move them outside
customize package to haskell-mode one.

Update doc strings a bit.
@gracjan
Copy link
Contributor

gracjan commented Jun 21, 2015

Baah. One more thing to check: does structured-haskell-mode work if you moved those variables? It might do (require 'haskell-customize) and there it can fail.

(Somebody asked what is a submarine dependency. Well, this is one example).

@gracjan
Copy link
Contributor

gracjan commented Jun 21, 2015

Okay, I've checked this and no issues with shm. Lets proceed.

gracjan added a commit that referenced this pull request Jun 21, 2015
Turn haskell-ghc-supported-(extensions|options) options to variables
@gracjan gracjan merged commit 7356b23 into haskell:master Jun 21, 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.

3 participants