Conversation

LuaRocks using three spaces for indentation is absolutely disturbing. Its described as a middle-ground between two and four space indentation, but feels worse than either of the others. An odd number indentation? This is ridiculous.

1
2
0

@justsoup the solution is, has been, and will continue to be tab indentation.

indentation should be explicit, not implicit

1
0
1
@hexaheximal @justsoup only if you consistently use tabs only for indentation and spaces only for alignment. emacs requires smart-tabs-mode to get this right, which is unmaintained and doesn't load on modern versions of emacs without modifications

(also for certain styles of indentation, such as how lisp is normally indented, tabs are horrible)
2
0
1

@noisytoot @justsoup tabs for indentation, space for... well.. spacing...

this is a solved problem

0
0
0

@noisytoot @hexaheximal I like tabs because each contributor can set their rendering size to their preferences. 2 vs 4 space indentations doesn't matter when it can be the size of both. There are times where space formatting is needed though, but I rarely work with languages where that's good practice.

1
0
0

@justsoup @noisytoot I have definitely found myself switching tab render sizes between languages

1
0
0

@hexaheximal @justsoup emacs just handles them badly by default (without something like smart-tabs-mode)

firstly, tabs don’t exactly have a fixed width: they end at the next tab stop and the width is just the distance between the tab stops (this isn’t emacs-specific, that’s just how tabs work). with tabs only at the beginning of the line and not mixing tabs and spaces this shouldn’t matter much

how emacs handles them is it has a tab-width that’s the distance between tab stops, and a separate mode-specific variable (e.g. c-basic-offset for C) that defines the indentation width, in spaces. if indent-tabs-mode is enabled, then it will indent with tabs first and fill the rest with spaces. the problem is that for some things it will try to align, and it will mix tabs and spaces for that (meaning that tab-width actually affects the contents of the file, it’s not just the display width)

smart-tabs-mode fixes this (by making it correctly use tabs for indentation and spaces for alignment), but it’s not the default and requires installing an unmaintained third-party package that requires modifications to work at all

1
0
0
@hexaheximal @justsoup in order to get sensible indentation behaviour with tabs in emacs, you need smart-tabs-mode and for tab-width to be equal to the c-basic-offset (or equivalent). the problem with the latter is it means you can't enforce sane indentation behaviour via mode-line comments (the "-*- mode: c; -*-" thing) or .dir-locals.el without either also enforcing a default display tab width or making it sufficiently complex that emacs will ask you whether you really want to load the .dir-locals.el because it might execute arbitrary code (you can't reference other variables without that)
0
0
0