[erlang-questions] Indentation of multiline strings

Steve Vinoski <>
Fri Feb 7 14:38:02 CET 2014


On Fri, Feb 7, 2014 at 3:29 AM, Vlad Dumitrescu <> wrote:

> Hi,
>
> I got a question about a file that was indented in a strange way by
> the script I put together, and thus by the erlang-mode indenter, and
> the problem is related to multiline strings.
>
> I can't see any such strings in lib/tools/emacs/test.erl.*, and when
> looking at the erlang-indent functions it looks like it works line by
> line, meaning that there is no way that multiline strings will get
> handled properly. But I may be wrong, as it's been a long time since
> reading lisp code.
>

Emacs erlang-mode doesn't get some multi-line entities like strings and
binaries right. See this message and the associated thread:

http://erlang.org/pipermail/erlang-bugs/2013-August/003729.html

The fix isn't trivial, and for those of us who use emacs, these entities
appear so rarely in practice that manually indenting them properly takes
little effort.


> 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.

--steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140207/97863b2f/attachment.html>


More information about the erlang-questions mailing list