Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  tabs versus spaces

Guest
Posted: Wed May 30, 2007 12:54 pm Reply with quote
Guest
Hello,

I've noticed that some of the Yaws source is rather difficult to read
due to inconsistent use of whitespace. Within the *.erl files in the
src directory there are 7134 lines beginning with a tab, 4366 lines
beginning with a space, and 4572 lines that mix spaces and tabs at the
beginning of the line. Wouldn't it be better to use consistent
whitespace throughout the project?


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Wed May 30, 2007 9:07 pm Reply with quote
Guest
Brian Templeton wrote:
> Hello,
>
> I've noticed that some of the Yaws source is rather difficult to read
> due to inconsistent use of whitespace. Within the *.erl files in the
> src directory there are 7134 lines beginning with a tab, 4366 lines
> beginning with a space, and 4572 lines that mix spaces and tabs at the
> beginning of the line. Wouldn't it be better to use consistent
> whitespace throughout the project?
>

This is the way emacs does it. I guess at least 50% of all opensource code
is written with emacs. What tool do you use to view the code. I guess vi does the
same, but I don't know.

/klacke


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Wed May 30, 2007 9:17 pm Reply with quote
Guest
On 5/30/07, Claes Wikstrom <klacke@tail-f.com> wrote:
> Brian Templeton wrote:
> > Hello,
> >
> > I've noticed that some of the Yaws source is rather difficult to read
> > due to inconsistent use of whitespace. Within the *.erl files in the
> > src directory there are 7134 lines beginning with a tab, 4366 lines
> > beginning with a space, and 4572 lines that mix spaces and tabs at the
> > beginning of the line. Wouldn't it be better to use consistent
> > whitespace throughout the project?
> >
>
> This is the way emacs does it. I guess at least 50% of all opensource code
> is written with emacs. What tool do you use to view the code. I guess vi does the
> same, but I don't know.
>

It depends on the mode. Python mode for example uses spaces for
everything, no tabs whatsoever. Erlang mode could be "fixed" to do
something more consistent too.

vim doesn't normally do the same thing.

-bob

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Wed May 30, 2007 9:35 pm Reply with quote
Guest
I would tend to agree that it should only indent with spaces, or
indent with tabs, however I think the erlang standard of 4 spaces is
easier to deal with in general. Erlang-mode is maintained in the otp
package so maybe this should be taken to erlang-users list or
erlang-bugs list.

Mog

On 5/30/07, Bob Ippolito <bob@redivi.com> wrote:
> On 5/30/07, Claes Wikstrom <klacke@tail-f.com> wrote:
> > Brian Templeton wrote:
> > > Hello,
> > >
> > > I've noticed that some of the Yaws source is rather difficult to read
> > > due to inconsistent use of whitespace. Within the *.erl files in the
> > > src directory there are 7134 lines beginning with a tab, 4366 lines
> > > beginning with a space, and 4572 lines that mix spaces and tabs at the
> > > beginning of the line. Wouldn't it be better to use consistent
> > > whitespace throughout the project?
> > >
> >
> > This is the way emacs does it. I guess at least 50% of all opensource code
> > is written with emacs. What tool do you use to view the code. I guess vi does the
> > same, but I don't know.
> >
>
> It depends on the mode. Python mode for example uses spaces for
> everything, no tabs whatsoever. Erlang mode could be "fixed" to do
> something more consistent too.
>
> vim doesn't normally do the same thing.
>
> -bob
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Erlyaws-list mailing list
> Erlyaws-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/erlyaws-list
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Thu May 31, 2007 12:27 am Reply with quote
Guest
Claes Wikstrom <klacke@tail-f.com> writes:

> Brian Templeton wrote:
>> Hello,
>>
>> I've noticed that some of the Yaws source is rather difficult to read
>> due to inconsistent use of whitespace. Within the *.erl files in the
>> src directory there are 7134 lines beginning with a tab, 4366 lines
>> beginning with a space, and 4572 lines that mix spaces and tabs at the
>> beginning of the line. Wouldn't it be better to use consistent
>> whitespace throughout the project?
>>
>
> This is the way emacs does it. I guess at least 50% of all
> opensource code is written with emacs. What tool do you use to view
> the code. I guess vi does the same, but I don't know.
>

I use Emacs with a tab-width of 8, which results in incorrect
formatting in files like yaws_vdir.erl that use spaces for indentation
in some lines and tabs in others with a different tab-width.

I've always setq-default'd indent-tabs-mode to nil in my .emacs, so I
never use tabs in my own code.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Thu May 31, 2007 10:14 pm Reply with quote
Guest
this should work for everyone
(add-hook 'erlang-mode-hook '(lambda() (setq indent-tabs-mode nil)))

mog
On 5/30/07, Brian Templeton <bpt@tunes.org> wrote:
> Claes Wikstrom <klacke@tail-f.com> writes:
>
> > Brian Templeton wrote:
> >> Hello,
> >>
> >> I've noticed that some of the Yaws source is rather difficult to read
> >> due to inconsistent use of whitespace. Within the *.erl files in the
> >> src directory there are 7134 lines beginning with a tab, 4366 lines
> >> beginning with a space, and 4572 lines that mix spaces and tabs at the
> >> beginning of the line. Wouldn't it be better to use consistent
> >> whitespace throughout the project?
> >>
> >
> > This is the way emacs does it. I guess at least 50% of all
> > opensource code is written with emacs. What tool do you use to view
> > the code. I guess vi does the same, but I don't know.
> >
>
> I use Emacs with a tab-width of 8, which results in incorrect
> formatting in files like yaws_vdir.erl that use spaces for indentation
> in some lines and tabs in others with a different tab-width.
>
> I've always setq-default'd indent-tabs-mode to nil in my .emacs, so I
> never use tabs in my own code.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Erlyaws-list mailing list
> Erlyaws-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/erlyaws-list
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum