[erlang-questions] Is there any erlang code formatting tool?

Liu Yubao <>
Tue Feb 3 07:46:14 CET 2009


Hi,

I prefer Vim to edit and Emacs to format erlang code but
switching between two editors is very inconvenient. Is
there any erlang code formatting tool? Or how can I use emacs
to format erlang source files in batch?

The default setting of erlang-mode indent code by tab characters
and spaces, I prefer four spaces to one tab, how to change the
setting of erlang-mode to make it indent code with four spaces?

Below is output from vim(et ts=4 sw=4) and emacs(default setting):

---------------vim, formatted with "gg=G":
{ehtml,
    {table, [{border, "1"}, {cellpadding, "2"}, {cellspacing, "2"}],
        [{thead, [],
                {tr, [],
                    [{th, [], "File path"},
                        {th, [], "Module name"},
                        {th, [], "Last modified time"},
                        {th, [], "Status"}]}},
            {tbody, [], Rows}]}}.

----------------emacs:
{ehtml,
 {table, [{border, "1"}, {cellpadding, "2"}, {cellspacing, "2"}],
  [{thead, [],
    {tr, [],
     [{th, [], "File path"},
      {th, [], "Module name"},
      {th, [], "Last modified time"},
      {th, [], "Status"}]}},
   {tbody, [], Rows}]}}.



More information about the erlang-questions mailing list