Quantcast

erlang-mode emacs tabs vs spaces

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

erlang-mode emacs tabs vs spaces

mog-3
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
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: erlang-mode emacs tabs vs spaces

Bengt Kleberg
On 2007-05-31 15:07, Matthew O'Gorman wrote:
...deleted
> 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?

you could use an erlang pretty printer (i use erl_prettypr in
syntax_tools) before checking in the code in your <revision-system>.


bengt
--
Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: erlang-mode emacs tabs vs spaces

mog-3
There are probably lots of fairly easy ways one could work around
this, I am just suggesting that a mix of tabs and spaces seems silly
at best unless there is some reason I'm unaware of it would be better
to go to the python route and just have it consistent.

mog

On 5/31/07, Bengt Kleberg <[hidden email]> wrote:

> On 2007-05-31 15:07, Matthew O'Gorman wrote:
> ...deleted
> > 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?
>
> you could use an erlang pretty printer (i use erl_prettypr in
> syntax_tools) before checking in the code in your <revision-system>.
>
>
> bengt
> --
> Those were the days...
>     EPO guidelines 1978: "If the contribution to the known art resides
>     solely in a computer program then the subject matter is not
>     patentable in whatever manner it may be presented in the claims."
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: erlang-mode emacs tabs vs spaces

mog-3
I have provided myself with a simple fix this
(add-hook 'erlang-mode-hook '(lambda() (setq indent-tabs-mode nil)))
should work in your .emacs will cause erlang.el to not produce such
messy output i hope other people adopt it.

mog

On 5/31/07, Matthew O'Gorman <[hidden email]> wrote:

> There are probably lots of fairly easy ways one could work around
> this, I am just suggesting that a mix of tabs and spaces seems silly
> at best unless there is some reason I'm unaware of it would be better
> to go to the python route and just have it consistent.
>
> mog
>
> On 5/31/07, Bengt Kleberg <[hidden email]> wrote:
> > On 2007-05-31 15:07, Matthew O'Gorman wrote:
> > ...deleted
> > > 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?
> >
> > you could use an erlang pretty printer (i use erl_prettypr in
> > syntax_tools) before checking in the code in your <revision-system>.
> >
> >
> > bengt
> > --
> > Those were the days...
> >     EPO guidelines 1978: "If the contribution to the known art resides
> >     solely in a computer program then the subject matter is not
> >     patentable in whatever manner it may be presented in the claims."
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: erlang-mode emacs tabs vs spaces

mog-3
I am an emacs user, I just work with vim users as well and think it is
very silly to be so utterly inconsistent.  The fix, the line i
proposed or others should be trivial to add to the erlang-mode.  But
seeing as how no one wants to fix the other issues, electric return
key etc.  I doubt anyone will fix this one, I just thought it should
be brought up.

mog
On 6/1/07, Vance Shipley <[hidden email]> wrote:

> Matthew,
>
> It is truly a mess however you just need to live with it.
> The emacs vs. vi arguments quickly turn religious and no
> one wants to start such a flamefest here.  It is also not
> reasonable to suggest that the OTP team commit a change to
> nearly every linbe of source code just to satisfy us vim
> users.  Emacs is the official IDE for Erlang/OTP.
>
>         -Vance
>
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: erlang-mode emacs tabs vs spaces

Per Hedeland
"Matthew O'Gorman" <[hidden email]> wrote:
>
>I am an emacs user, I just work with vim users as well and think it is
>very silly to be so utterly inconsistent.  The fix, the line i
>proposed or others should be trivial to add to the erlang-mode.

AFAIK the tabs-in-indentation usage that is the default in erlang-mode
is "emacs standard" - certainly at least cc-mode, shell-script-mode, and
perl-mode do the same by default. And whatever you think of this
"feature" (I can agree with "silly", but not "inconsistent", let alone
"utterly"), I don't think erlang.el should hardwire something that it is
different from "standard default". You found the customization knob,
fine (and thanks for reporting it), now you - or any project that
decides on it - just need to use it.

--Per Hedeland
_______________________________________________
erlang-questions mailing list
[hidden email]
http://www.erlang.org/mailman/listinfo/erlang-questions
Loading...