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}]}}.
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
I have used parts of the Syntax_Tools
(http://erlang.org/doc/apps/syntax_tools/index.html) for Erlang
formatting without Emacs.
For batch processing of files you might want to look at erl_tidy
(http://erlang.org/doc/man/erl_tidy.html).
If you want a tool that takes care of a function in a file, you can talk
to me.
bengt
Thank you very much, I should have digged the document more carefully.
Hi,
If you put this in your .vimrc, you can ask Emacs to indent the file
that you are editing by typing :IndentErl.
command! IndentErl call IndentErlangWithEmacs()
function! IndentErlangWithEmacs()
exec '!emacs --eval "(progn (find-file \"' . expand('%:p') . '\")' .
\ '(erlang-indent-current-buffer) (save-buffer) '.
\ '(save-buffers-kill-emacs))"'
endfunction
Csaba
> Liu Yubao wrote:
>> 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?
Have a look here:
http://blog.tornkvist.org/blog.yaws?id=1233867602690448
--Tobbe
>
> Hi,
>
> If you put this in your .vimrc, you can ask Emacs to indent the file
> that you are editing by typing :IndentErl.
>
> command! IndentErl call IndentErlangWithEmacs()
>
> function! IndentErlangWithEmacs()
> exec '!emacs --eval "(progn (find-file \"' . expand('%:p') . '\")' .
> \ '(erlang-indent-current-buffer) (save-buffer) '.
> \ '(save-buffers-kill-emacs))"'
> endfunction
>
> Csaba
--
KREDITOR EUROPE AB
S:t Eriksgatan 117
SE-113 43 Stockholm, Sweden
Tel: +46(0)8-120 120 00
Fax: +46(0)8-120 120 99
Email: torbjorn....@kreditor.se
Web: www.kreditor.se