[erlang-questions] Controversial subject of the day: tabs and spaces for indentation
Thu Feb 6 13:48:19 CET 2014
These are my opinions, not facts.
"erl-indent" can only be used on the OTP files that follow the style
guide they recommend. Even if that is just a few it is better than the
current cut-and-paste of tabs and spaces that I have to do in all files.
Thank you for the tool.
On Thu, 2014-02-06 at 12:35 +0100, Vlad Dumitrescu wrote:
> On 6 Feb 2014 12:27, "Bengt Kleberg" <>
> > Greetings,
> > These are my opinions, not facts.
> > Does your "erl-indent" program format according to the current OTP
> > guide? It would be very good if that was the case.
> It uses erlang - mode to indent. I certainly assume that it uses the
> style recommended by otp.
> Not all otp source files are idempotent under the indentation, so it
> might mean that not all are following the otp style.
> > bengt
> > On Thu, 2014-02-06 at 10:43 +0100, Vlad Dumitrescu wrote:
> > > On Thu, Feb 6, 2014 at 10:31 AM, Lukas Larsson <>
> > > > On Thu, Feb 6, 2014 at 9:38 AM, Loïc Hoguin <>
> > > >>
> > > >> Plus this doesn't help your code get merged at all. If you
> submit code
> > > >> with broken whitespace, then tools will also display this
> whitespace change.
> > > >> You can of course hide whitespace changes, but the problem is
> > > >> whitespace does matter in some places, so you're basically
> > > >> potentially important information by doing that.
> > > >>
> > > > This is in my opinion the reason why it would be a very bad
> thing to do a
> > > > huge commit that changes the current whitespace format of a
> project to
> > > > another. It is already very hard to figure out what change could
> have caused
> > > > a bug without having to deal with whitespace changes in the
> middle of a
> > > > diff.
> > >
> > > Yes, if such a thing would be done, the best time is as a separate
> > > commit right before a release, this will minimize the number of
> > > merges/rebases with mixed styles of indentation. Of course, as
> > > points out, if diffing with older code, then you have a problem.
> > >
> > > Anyway, I have a suggestion for a workaround at
> > > https://gist.github.com/vladdu/8841089. Put those files in your
> > > (which should be on $PATH), edit them to match your system and
> > > and you can reindent files simply by running "erl-indent
> > > /path/to/myfile.erl". It still requires to have emacs installed,
> but I
> > > can live with that.
> > >
> > > The downside is that if you want to use only spaces, then the
> > > file will be changed to use them. The really big downside is that
> > > this tool there will be even less incitament to change the
> > > style...
> > >
> > > regards,
> > > Vlad
> > > _______________________________________________
> > > erlang-questions mailing list
> > >
> > > http://erlang.org/mailman/listinfo/erlang-questions
> > _______________________________________________
> > erlang-questions mailing list
> > http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions