[erlang-questions] erlang-mode emacs tabs vs spaces

Matthew O'Gorman mogorman@REDACTED
Thu May 31 15:07:41 CEST 2007


Recently on the erlyaws list it has been brought up that erlang-mode
for emacs uses a combination of tabs and spaces for its indentation.
for example

-record(local, {index,
		location}).
the above uses 2 tabs to line up in emacs where as
add_location(Location) ->
    Fun = fun() ->
		   mnesia:write(#location{index = ,
					  location = Location}),
		   end,
    mnesia:transaction(Fun).

actually uses a combination of tabs and spaces for the whitespace. the
mnesia line has 2 tabs and 3 spaces and the line after that has 5 tabs
and 1 space.  seems like when anything is tabbed more than 4 spaces
emacs uses a tab to help fill the space at least in my environment.

I never even realized any of this as all of this is handled
beautifully in emacs, however for the unfortunate using vim, or other
editors ^_^ This could be a problem I imagine, especially if working
together on a large project where formatting needs to be the same.   I
imagine it would be easiest to convert all to spaces, or to just use
tabs.  I think it would probably be best to just use spaces, what do
yall think?

Mog



More information about the erlang-questions mailing list