Giter Club home page Giter Club logo

Comments (5)

chrisdone avatar chrisdone commented on May 17, 2024

Which indentation mode?

from haskell-mode.

bremner avatar bremner commented on May 17, 2024

turn-on-haskell-indentation

from haskell-mode.

hvr avatar hvr commented on May 17, 2024

I just tried with the latest version, and it gets indented as

Data D = A $
       | B$

i.e. the | is aligned with = as I'd expect... the only thing that's annoying IMHO is that left-over trailing space on the first line which I always need to remove manually (as trailing spaces are often frowned upon and rejected by commit validation scripts, e.g. git diff-index --check ...) .

However, I'm not sure if it's a defect in the first place, that <return> is bound to perform indenting (it's bound to haskell-newline-and-indent in that indentation mode) as I'm actually expecting the indentation mode to do something like that when I press <return>...

PS: on a second thought, maybe <return> should be bound to newline by default and C-j to newline-and-indent to follow common Emacs conventions (it just happens that I've been mapping newline-and-indent to <return> in my config for ages, that I forgot this isn't the default convention) to leave the user the choice whether to rebind <return> to newline-and-indent...

PS2: I noticed only now the issue-title, which wasn't inferable from the issue description to me, sorry for the noise

from haskell-mode.

bremner avatar bremner commented on May 17, 2024

It is interesting that the indentation behaviour is different in the latest version; I agree that the position of | is also annoying in 2.8.0, but apparently not to the guy who reported it to Debian originally ;)

from haskell-mode.

gracjan avatar gracjan commented on May 17, 2024

To keep whitespace issues under control use https://github.com/glasserc/ethan-wspace

C-mode uses standard newline-and-indent that removes excess whitespace.

haskell-indent uses standard newline-and-indent that removes excess whitespace.

haskell-indentation uses nonstandard haskell-newline-and-indent that does not remove excess whitespace. Anybody knows why does it have special code? What is the purpose?

Patch to make haskell-indentation remove excess whitespace is in pull request:

#43

Oh, I'm learning github... there are two unrelated patches in a single pull request... how surprizing.

from haskell-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.