Skip to content

Detect comma style #1099

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 2 commits into from
Jan 21, 2016
Merged

Detect comma style #1099

merged 2 commits into from
Jan 21, 2016

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Jan 21, 2016

As discussed in #1094. See the commit messages for more info.

Previously, `haskell-cabal-list-comma-position' was always used when
calling `haskell-cabal-subsection-arrange-lines'.

In haskell#1098, `haskell-cabal-list-comma-position' was respected unless the
no commas were found.

Instead of respecting `haskell-cabal-list-comma-position', detect the
currently used style and respect it when rearranging the section.

Possible styles:

before: a comma at the start of each line (except the first), e.g.
    Foo
  , Bar

after: a comma at the end of each line (except the last), e.g.
    Foo,
    Bar

single: everything on a single line, but comma-separated, e.g.
    Foo, Bar

nil: no commas, e.g.
    Foo Bar

If the styles are mixed, the position of the first comma determines the
style.
The current style is now detected, which is more flexible.
@geraldus
Copy link
Contributor

You rocks (:

@gracjan
Copy link
Contributor

gracjan commented Jan 21, 2016

This is really nice. Lets wait till it builds.

gracjan added a commit that referenced this pull request Jan 21, 2016
@gracjan gracjan merged commit f6eb793 into haskell:master Jan 21, 2016
@gracjan
Copy link
Contributor

gracjan commented Feb 4, 2016

@mrBliss, I notice that haskell-cabal.el has rather low test coverage and generally could use some love:

https://coveralls.io/files/1940562448#L724

Can you add some tests so that haskell-cabal.el is better taken care of?

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