Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: devel

[Bricolage-Devel] Whitespace

 

 

Bricolage devel RSS feed   Index | Next | Previous | View Threaded


mark at geekhive

May 16, 2002, 1:19 AM

Post #1 of 18 (994 views)
Permalink
[Bricolage-Devel] Whitespace

Hey all,

Sometime maybe have a look at the code with tabs visible...

http://www.emacswiki.org/cgi-bin/wiki.pl?ShowWhiteSpace



I know I've brought this up before, but it really seems odd
to me: as best as I can tell most of the code base
*appears* to have a tabstop setting of 4, but it doesn't
really.

Things are not what they appear since as best as I can tell
it only looks right if you set your editor to tabstop at 8.
So a tab is really two tabs, and you arrive at one tab by
adding four spaces... Is that something that emacs does on
it's own?

It seems pretty wacky from here. I don't actually have a
preference between spaces and tabs, but why mix them like
that?


Mark


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


sam at tregar

May 16, 2002, 8:14 AM

Post #2 of 18 (976 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On Thu, 16 May 2002, Mark Jaroski wrote:

> Things are not what they appear since as best as I can tell
> it only looks right if you set your editor to tabstop at 8.
> So a tab is really two tabs, and you arrive at one tab by
> adding four spaces... Is that something that emacs does on
> it's own?

Yes. This is the way cperl-mode auto-indents using the "Perl" style
indenting. This matches the perlstyle.pod standard of a "four column
indent." I'm pretty sure there's some way to tell it to never use
hard-tabs, but I've never had a reason to bother.

-sam


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 16, 2002, 8:27 AM

Post #3 of 18 (973 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

Sam Tregar wrote:
> Yes. This is the way cperl-mode auto-indents using the "Perl" style
> indenting. This matches the perlstyle.pod standard of a "four column
> indent." I'm pretty sure there's some way to tell it to never use
> hard-tabs, but I've never had a reason to bother.

I just read the perlstyle pod page, and I don't see anywhere
where it says to mix tabs and spaces.

Why not just set your tabstop to 4? Then I imagine that your
macro will do the right thing.


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


sam at tregar

May 16, 2002, 8:29 AM

Post #4 of 18 (980 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On Thu, 16 May 2002, Mark Jaroski wrote:

> I just read the perlstyle pod page, and I don't see anywhere
> where it says to mix tabs and spaces.

True. But it doesn't say you shouldn't, does it?

> Why not just set your tabstop to 4?

Because then all of Bricolage's code will look like garbage! I am not
going to manually re-indent 100,000 lines of code.

> Then I imagine that your macro will do the right thing.

This is not "my macro." This is Emacs/cperl-mode - probably the single
most popular editor used to program Perl. If you have issues with how it
works please feel free to take them up with the author - Ilya Zakharevich.

-sam


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 16, 2002, 9:21 AM

Post #5 of 18 (974 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

Sam Tregar wrote:
> > Why not just set your tabstop to 4?
>
> Because then all of Bricolage's code will look like garbage! I am not
> going to manually re-indent 100,000 lines of code.
>
> > Then I imagine that your macro will do the right thing.
>
> This is not "my macro." This is Emacs/cperl-mode - probably the single
> most popular editor used to program Perl. If you have issues with how it
> works please feel free to take them up with the author - Ilya Zakharevich.

OK, I've managed to reproduce this behavior in ViM, so you
won't hear me complain about this anymore, after I sneak
in this one little URL:

http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/devel/modperl_style/modperl_style.html


These guys seem to have the right idea.


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 16, 2002, 9:37 AM

Post #6 of 18 (973 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/16/02 10:21 AM, "Mark Jaroski" <mark [at] geekhive> claimed:

> http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/devel/modperl_st
> yle/modperl_style.html

This is a good one to know. FYI, this style is based on perlstyle. But I was
glad to see how to do the Emacs settings -- I've been wanting to know how to
eliminate tabs from my code for a while. My only preference over what's in
their example is that continued lines indent 2 spaces instead of 4, so that
they stand out from non-continued indents. So here's my .emacs section that
defines this stuff for cperl-mode:

;; CPerl custom variables.
(autoload 'perl-mode "cperl-mode"
"alternate mode for editing Perl programs" t)
(setq cperl-hairy t)
(setq auto-mode-alist
(append '(("\\.\\([pP][Llm]\\|al\\|pod\\)$" . cperl-mode))
auto-mode-alist ))
(setq interpreter-mode-alist (append interpreter-mode-alist
'(("miniperl" . cperl-mode))))
(custom-set-variables
'(case-fold-search t)
'(cperl-indent-level 4)
'(cperl-continued-statement-offset 2)
'(cperl-tab-always-indent t)
'(indent-tabs-mode nil))

I'm using cperl-mode v.4.32.

Now perhaps we can lay this issue to rest, hmm?

Regards,

David

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


sam at tregar

May 16, 2002, 9:54 AM

Post #7 of 18 (979 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On Thu, 16 May 2002, David Wheeler wrote:

> This is a good one to know. FYI, this style is based on perlstyle. But I was
> glad to see how to do the Emacs settings -- I've been wanting to know how to
> eliminate tabs from my code for a while. My only preference over what's in
> their example is that continued lines indent 2 spaces instead of 4, so that
> they stand out from non-continued indents. So here's my .emacs section that
> defines this stuff for cperl-mode:

Looks good to me. Care to make a patch to Bric::Hacker with the relevent
Emacs and VIM settings?

> Now perhaps we can lay this issue to rest, hmm?

Aw, c'mon, we didn't even get to the good stuff yet.

-sam


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 16, 2002, 10:05 AM

Post #8 of 18 (977 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/16/02 10:54 AM, "Sam Tregar" <sam [at] tregar> claimed:

> Looks good to me. Care to make a patch to Bric::Hacker with the relevent
> Emacs and VIM settings?

I'll supply the settings for Emacs, but I haven't a clue what they look like
for VIM. Maybe Mark can provide what he discovered to make it all work
nicely?

As I think about it and am editing Bric files in the future, I'll probably
run C<M-x untabify> on them.

David

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 17, 2002, 6:51 AM

Post #9 of 18 (972 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/17/02 12:30 AM, "Mark Jaroski" <mark [at] geekhive> claimed:

> I've attached the script that duplicates the behavior of
> cperl-mode. This script comes in the Vim distro, but I'm
> sending it just in case somebody needs it.
>
> In order to make bric files look right currently I add these
> settings after sourcing the file:
>
>
> set tabstop=8
> set softtabstop=4
> set shiftwidth=4

8? I don't understand that. We don't want indents to be 8 anywhere. Now,
there are a number of files that do have 8 spaces for tabs, but that's not
the rule.

> Next, in order stop making actual tabs, (while still having
> Bric files look right):
>
> set expandtab
>
>> As I think about it and am editing Bric files in the future, I'll probably
>> run C<M-x untabify> on them.
>
> Vim users can run the 'retab' command on the whole file or
> on a visual selection.

I patched Bric::Hacker with a fair bit of documentation on how to use
various modes in Emacs. I also added a header for Vim. Would you mind adding
documentation there?

Thanks,

David

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 17, 2002, 7:39 AM

Post #10 of 18 (977 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/17/02 8:16 AM, "Mark Jaroski" <mark [at] geekhive> claimed:

> I was reading some docs and email archives about that...
> Before this exchange I never actually understood why
> softtabstop existed. It turns out that it's in order make
> it possbile to mimic the cperl-mode in emacs. The tabstop
> setting stays at 8, but softtabstop makes sure that the
> macro tabs to four anyhow.

Interesting. Glad it works.

> Once everything is free of tabs, tabstop can be set to the
> correct value.

Feel free to untabify as you go. I will.

>> I patched Bric::Hacker with a fair bit of documentation on how to use
>> various modes in Emacs. I also added a header for Vim. Would you mind adding
>> documentation there?
>
> OK

Thanks!

David

PS: Do you mean to be cc'ing the devel list on your replies to me? Because
you're not.

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth [at] sourceforge
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 17, 2002, 8:08 AM

Post #11 of 18 (977 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

David Wheeler wrote:
> Feel free to untabify as you go. I will.

I just realized that this is going to make patches pretty
hard to read.


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________

Hundreds of nodes, one monster rendering program.
Now that’s a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 17, 2002, 8:18 AM

Post #12 of 18 (975 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/17/02 9:08 AM, "Mark Jaroski" <mark [at] geekhive> claimed:

> I just realized that this is going to make patches pretty
> hard to read.

True. Perhaps they should be separate patches. Untabify and then commit,
then make your changes and commit those. IOW< Don't mix untabify with other
changes.

Sound good, everybody?

David

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________

Hundreds of nodes, one monster rendering program.
Now that’s a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 17, 2002, 8:24 AM

Post #13 of 18 (976 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

David Wheeler wrote:
> True. Perhaps they should be separate patches. Untabify and then commit,
> then make your changes and commit those. IOW< Don't mix untabify with other
> changes.
>
> Sound good, everybody?

OK, 'cept the next set will be in the reverse order...


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________

Hundreds of nodes, one monster rendering program.
Now that’s a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


ask at develooper

May 18, 2002, 2:18 AM

Post #14 of 18 (977 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On Thu, 16 May 2002, David Wheeler wrote:

> As I think about it and am editing Bric files in the future, I'll probably
> run C<M-x untabify> on them.

please do that in separate commits; and take care in not doing it to
files other people are likely to have uncommitted patches to.


- ask

--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();


_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


ask at develooper

May 18, 2002, 2:19 AM

Post #15 of 18 (977 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On Fri, 17 May 2002, David Wheeler wrote:

> On 5/17/02 9:08 AM, "Mark Jaroski" <mark [at] geekhive> claimed:
>
> > I just realized that this is going to make patches pretty
> > hard to read.
>
> True. Perhaps they should be separate patches. Untabify and then commit,
> then make your changes and commit those. IOW< Don't mix untabify with other
> changes.

oh, "what he said" then.

otherwise using -w to diff (or cvs diff) is useful to decipher
patches with whitespace changes.

- ask

--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
http://www.askbjoernhansen.com/


_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 18, 2002, 4:00 AM

Post #16 of 18 (974 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

Ask Bjoern Hansen wrote:
> otherwise using -w to diff (or cvs diff) is useful to decipher
> patches with whitespace changes.

Good point. I think that should go into hacker.pod with the
rest of the stuff...


--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


mark at geekhive

May 18, 2002, 6:41 AM

Post #17 of 18 (974 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

Ask Bjoern Hansen wrote:
> otherwise using -w to diff (or cvs diff) is useful to decipher
> patches with whitespace changes.

I guess we're probably going to want to add that to the cvs
log script...

--
--
=================================================================
-- mark at geekhive dot net --

_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel


david at wheeler

May 18, 2002, 2:28 PM

Post #18 of 18 (974 views)
Permalink
Re: [Bricolage-Devel] Whitespace [In reply to]

On 5/18/02 7:41 AM, "Mark Jaroski" <mark [at] geekhive> claimed:

> Ask Bjoern Hansen wrote:
>> otherwise using -w to diff (or cvs diff) is useful to decipher
>> patches with whitespace changes.
>
> I guess we're probably going to want to add that to the cvs
> log script...

File a bug report on that count and I'll try to take care of that this week.
I'll probably add a command-line option to activitymail that will be passed
to cvs diff.

David

--
David Wheeler AIM: dwTheory
david [at] wheeler ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory [at] jabber



_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel [at] lists
https://lists.sourceforge.net/lists/listinfo/bricolage-devel

Bricolage devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.