[erlang-questions] Indentation of multiline strings
Fri Feb 7 15:09:25 CET 2014
On Fri, Feb 7, 2014 at 2:38 PM, Steve Vinoski <> wrote:
> On Fri, Feb 7, 2014 at 3:29 AM, Vlad Dumitrescu <> wrote:
>> What is the official position regarding indenting multiline strings?
>> If the emacs indentation code is broken, it means one can't reindent
>> files without risking trouble...
> You're trying to automate something that until now has not been automated,
> at least not in public view to the best of my knowledge, so you're going to
> hit problems like these. From what I've seen, users currently tend to indent
> these problem areas manually so that they appear the way they would if
> erlang-mode got them right.
Well, yes, I am trying to provide tools that will help people focus on
what is important instead of having to remember which files can be
reindented and which one can't (for example). Tools that work as
expected, without nasty effects that may only be noticed later. The
kind of tools that Joe and others asked for. If people are happy doing
this kind of manual work, please let me know so that I can work on
something more useful, but please don't say later that "the tools are
In order to be able to do that, there has to be a specification, so
that people know what to expect. In this particular case, that
specification would be an official indentation and formatting guide,
that in practice would become the standard way of doing it. The
current situation is that the emacs implementation is that
specification (for indenting), except that it has some cases where it
doesn't work. There are also some Erlang pretty printers
(erl_prettypr, erl_tidy), but these have their problems too as they
rely on the code to be parsable and I don't know how much their output
matches that of the emacs indenter and with each other.
Wouldn't it be nice if there was an implementation independent
specification? I am willing to put one together. This will make it
much easier to make sure that the erlang support for different editors
and IDEs is formatting the code in the same way and we can take the
opportunity to specify (and maybe even implement) all the edge cases
that emacs gets wrong.
More information about the erlang-questions