Comments (5)
Which indentation mode?
from haskell-mode.
turn-on-haskell-indentation
from haskell-mode.
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.
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.
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:
Oh, I'm learning github... there are two unrelated patches in a single pull request... how surprizing.
from haskell-mode.
Related Issues (20)
- Syntax highlighting confused by lack of spaces HOT 1
- Extend haskell-build-type to look for .nix files
- Four space indentation HOT 2
- QuasiQuotes that are not part of the Haskell standard or haskell-font-lock-quasi-quote-modes will cause haskell-indentation to be incorrect afterwards
- Upstream Mac M1 Stack issue causing run-haskell to fail for Stack projects
- True TRAMP Support
- haskell-session-change-target unusable in cabal package with multiple library stanzas HOT 1
- C-c C-c `haskell-process-cabal-build` won't work if haven't ran C-c C-l
- Cabal repl without a cabal file
- tree-sitter HOT 1
- add topics HOT 1
- Feature request: "cabal repl" with file target HOT 1
- Haskell repl freezes when I run getChar HOT 1
- string-trim-left redefinition vs quasi-quote tests in emacs 29.1 HOT 3
- Should `haskell-cabal` mode derive from `prog-mode`? HOT 4
- Color escape sequences from `cabal repl` causing garbled output (Cabal 3.10.1.0) HOT 3
- `deriving someStrategy ...` breaks indentation in the rest of the file
- flymake-allowed-file-name-masks is void HOT 3
- haskell-cabal: bad indentation with redundant leading comma
- error "Marker does not point anywhere"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-mode.