haskell / haskell-mode

Emacs mode for Haskell
http://haskell.github.io/haskell-mode/
GNU General Public License v3.0
1.33k stars 344 forks source link

Unify haskell-indentation defcustoms into one variable #952

Open gracjan opened 9 years ago

gracjan commented 9 years ago

All of those should be replaced by a single defcustom:

'(haskell-indentation-ifte-offset 4)
'(haskell-indentation-layout-offset 4)
'(haskell-indentation-left-offset 4)
'(haskell-indentation-starter-offset 4)
'(haskell-indentation-where-post-offset 4)
'(haskell-indentation-where-pre-offset 4)

That defcustom should inherit value from c-basic-offset.

emmanueltouzery commented 9 years ago

I think there are people who have a do offset at 4 and a where offset at 2. I would not merge those values.

Shimuuar commented 9 years ago

Indeed. For example Johan Tibell: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md

gracjan commented 9 years ago

Tibell style has only where as exception. This is way less than 6 special undocumented cases that we have now.

bgamari commented 9 years ago

It's actually unclear to how one is supposed to replicate @tibbe's style with haskell-indentation currently. I currently use,

 '(haskell-indentation-ifte-offset 4)
 '(haskell-indentation-layout-offset 4)
 '(haskell-indentation-left-offset 4)

as recommended in haskell-style.el and yet bindings in where clauses are indented two spaces too far,

hello hi = do
    doThings aBinding
  where
      aBinding = hi

What am I missing here?

gracjan commented 8 years ago

@bgamari: looks like a bug to me.

bgamari commented 8 years ago

Note that the indentation issue that I mention above came up again in #1042.