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

Broken indentation in Emacs 24.5 #1013

Closed
jstolarek opened this issue Dec 2, 2015 · 14 comments
Closed

Broken indentation in Emacs 24.5 #1013

jstolarek opened this issue Dec 2, 2015 · 14 comments

Comments

@jstolarek
Copy link

I recently updated my Emacs installation to version 24.5.1 and discovered that in haskell mode upon entering a new line indentation behaves in an unexpected and unintuitive way. In these examples below X shows where the point is set upon pressing Enter at the end of previous line and Y shows where it used to be set before upgrading Emacs:

module Foo where
Y   X
foo :: Bool
Y      X
data A = A

Y      X
instance Foo a where
    bar A A = A
    Y       X

Using haskell-mode just became extremely annoying :| I am using haskell-mode from melpa, version 20151202.34 (ie. today's build).

@jstolarek
Copy link
Author

Oh, and this behaviour happens consistently on two different machines. Both have Emacs 24.5.1 compiled from sources, haskell-mode from melpa and this configuration file.

@gracjan
Copy link
Contributor

gracjan commented Dec 2, 2015 via email

@jstolarek
Copy link
Author

Indeed, that changes indentation behaviour, but it does not restore previous, correct behaviour. For example, indentation of case alternatives does not work in a reasonable way. Also, if I have:

foo :: Bool
X

where X represents mark, I would expect that pressing TAB will insert foo. But after commenting out that configuration line it doesn't.

So I would say that what you've given me is a workaround that restores reasonable indentation behaviour at the price of loosing functionality. Thank you for that, but it is not the final solution I am looking for.

@gracjan
Copy link
Contributor

gracjan commented Dec 2, 2015

It seems we should reopen #208.

@gracjan gracjan closed this as completed Dec 15, 2015
@jstolarek
Copy link
Author

Closed means fixed?

@gracjan
Copy link
Contributor

gracjan commented Dec 16, 2015

You seem to have found a way to make indentation work so I guess this part is fixed.

There is the unimplemented feature of haskell-indentation-mode that is present in haskell-indent-mode that is symbol completion.

You are the second person requesting that and I'm not sure if this is an expected feature or not. Anyway we will need a volunteer to implement it.

@gracjan
Copy link
Contributor

gracjan commented Dec 16, 2015

Anyway submitted as separate issue #1027.

@jstolarek
Copy link
Author

You seem to have found a way to make indentation work so I guess this part is fixed.

No, I have not been able to restore previous functionality in a reasonable way, ie. after disabling indentation the problem went away but so did useful functionality. So in no way is my problem solved :( Perhaps this is a duplicate of #208 (as you've pointed out), but in such case please re-open #208.

You are the second person requesting that and I'm not sure if this is an expected feature or not.

I believe I am not requesting any new feature. Completing function name has been present in haskell-mode since I started using it ~3 years ago.

@gracjan
Copy link
Contributor

gracjan commented Dec 17, 2015

Opened as #1027.

@jstolarek
Copy link
Author

Ok, clearly there is something I don't understand here. From reading #1027 I understand that so far I have been using haskell-indent. After updating Emacs to 24.5 behaviour of haskell-indent is broken and I was forced to turn it off (obviously, losing its functionality). #1027 mentions something about haskell-indentation. Is haskell-indentation a replacement of haskell-indent? Is haskell-indent deprecated or unmaintained and should not be used?

@gracjan
Copy link
Contributor

gracjan commented Dec 17, 2015

Your understanding is about correct. haskell-indentation is next attempt at indentation mode after haskell-indent. So far haskell-indentation code has been proved to be more readable and maintanable, at least compared to haskell-indent. Although haskell-indent is not deprecated I think it will be a problem to find a brave soul to fix issues with that indetation mode. Currently all the effort goes into haskell-indentation.

@jstolarek
Copy link
Author

Now it makes sense. Thanks. I'll switch to haskell-indentation and hope someone implements #1027

@PierreR
Copy link
Contributor

PierreR commented Dec 17, 2015

Wouldn't be clearer to remove haskell-indent completely ? It is not maintained and broken. What's the point keeping it knowing there is no contributor out there to work on it.

I personally would vote for a single indentation scheme that works well (instead of 3 broken option).

The way I understand it is that the initial creator/contributor of haskell-indent is gone without caring for the transition. So it is fair to say haskell-indent is dead IMHO.

@gracjan
Copy link
Contributor

gracjan commented Dec 17, 2015

@PierreR: We are slowly getting there. It is time to reduce the number from three to two by removing haskell-simple-ident in #958.

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

3 participants