Re: [28702] trunk/base/HACKING

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [28702] trunk/base/HACKING

markd-2
[hidden email] writes:

>Added: trunk/base/HACKING (0 => 28702)
>
>
>--- trunk/base/HACKING                        (rev 0)
>+++ trunk/base/HACKING 2007-09-07 18:34:33 UTC (rev 28702)
>@@ -0,0 +1,13 @@
>+Whitespace rules as discussed on the list:
>+
>+* All source code files MUST use soft tabs at a tabstop of 4. No hard
>tabs are allowed.
>+* All source code files SHOULD have the following as the first line of
>the file:
>+       # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil;
>c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
>+   This is a modeline that works for both emacs and vim.
>+* Portfiles SHOULD use soft tabs at a tabstop of 4, but implementation
>of this is left up to the discretion of the maintainer.
>+* Portfiles SHOULD use the given modeline
>+* Makefiles MUST use tabs as it is required by the syntax. Makefiles
>SHOULD use a tab stop of 8.
>+* Makefiles MAY use a modeline. The following works for emacs and vim:
>+       # -*- Mode: Makefile; tab-width: 8; indent-tabs-mode: t -*-
>vim:noet:sw=8:ts=8
>+* All other files (documentation, etc) SHOULD use soft tabs at a tabstop
>of 4 if the document format allows.
>+* All other files (documentation, etc) SHOULD NOT use a modeline as it
>is probably meant for human consumption.

I think that separately sprinkling documentation around in svn is
something that shouldn't be done anymore. They are parallel documentation
trains. I think they should be put into Trac tickets for inclusion in
official docs, which are the guide and man pages.  I just included some
things from base/doc/INTERNALS into the guide, and it should really be
deleted now.  An email in a few minutes will spell out more details.

Mark

_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev
Reply | Threaded
Open this post in threaded view
|

Re: [28702] trunk/base/HACKING

Jochen Küpper
On 07.09.2007, at 20:34, [hidden email] wrote:

> +       # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-
> basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4

Shouldn't there be a "coding: utf-8" in there, at least for Portfiles?

Greetings,
Jochen
--
Einigkeit und Recht und Freiheit                http://www.Jochen- 
Kuepper.de
     Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll



_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [28702] trunk/base/HACKING

Ryan Schmidt-24

On Sep 9, 2007, at 15:48, Jochen Küpper wrote:

> On 07.09.2007, at 20:34, [hidden email] wrote:
>
>> +       # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-
>> basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
>
> Shouldn't there be a "coding: utf-8" in there, at least for Portfiles?

Portfiles must be utf-8, so whatever we can do to inform emacs and  
vim of that should be done.



_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev
Reply | Threaded
Open this post in threaded view
|

Source editing standards: Modeline (Re: [28702] trunk/base/HACKING)

Juan Manuel Palacios-2
In reply to this post by Jochen Küpper

On Sep 9, 2007, at 4:48 PM, Jochen Küpper wrote:

> On 07.09.2007, at 20:34, [hidden email] wrote:
>
>> +       # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-
>> basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
>
> Shouldn't there be a "coding: utf-8" in there, at least for Portfiles?
>
> Greetings,
> Jochen
>


        So, we need to come to a final agreement on the modelines we're  
going to impose/request in our source files/Portfiles:

1) Source files: # -*- coding: utf-8; Mode: Tcl; tab-width: 4; indent-
tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
2) Portfiles (it's the same as above, is that recommended?): # -*-  
coding: utf-8; Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-
basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
3) Makefiles: # -*- Mode: Makefile; tab-width: 8; indent-tabs-mode: t  
-*- vim:noet:sw=8:ts=8

        Any objections to those? Something to add? Is casing of keywords  
right (Tcl or tcl)?

        Once we agree on the exact formats we should document them and  
everyone should stick to them, even in the order of the components.

        Regards,...


-jmpp

PS: Actual conversion of the files will probably be implemented on a  
file by file basis, unfortunately, as a regex to convert everything  
in one fell swoop is very difficult to construct and very error  
prone, I believe (as also advised by Kevin).

_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev
Reply | Threaded
Open this post in threaded view
|

Re: Source editing standards: Modeline (Re: [28702] trunk/base/HACKING)

Kevin Ballard-2
On Sep 10, 2007, at 6:18 PM, Juan Manuel Palacios wrote:

On Sep 9, 2007, at 4:48 PM, Jochen Küpper wrote:


On 07.09.2007, at 20:34, [hidden email] wrote:


+       # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4


Shouldn't there be a "coding: utf-8" in there, at least for Portfiles?


Greetings,

Jochen



So, we need to come to a final agreement on the modelines we're going to impose/request in our source files/Portfiles:


1) Source files: # -*- coding: utf-8; Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4

2) Portfiles (it's the same as above, is that recommended?): # -*- coding: utf-8; Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4

3) Makefiles: # -*- Mode: Makefile; tab-width: 8; indent-tabs-mode: t -*- vim:noet:sw=8:ts=8


Any objections to those? Something to add? Is casing of keywords right (Tcl or tcl)?


I don't know if it makes a difference, not being an Emacs person, but I think the Mode keyword is supposed to come first. Also we should probably have file encoding in the modeline

# -*- Mode: Tcl; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

Once we agree on the exact formats we should document them and everyone should stick to them, even in the order of the components.




_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev
Reply | Threaded
Open this post in threaded view
|

Re: Source editing standards: Modeline (Re: [28702] trunk/base/HACKING)

Jochen Küpper
Please forward to [hidden email], as I am not  
subscribed there  (Cannot post)

On 11.09.2007, at 00:51, Kevin Ballard wrote:

>> Any objections to those? Something to add? Is casing of keywords  
>> right (Tcl or tcl)?

Shouldn't matter; personally I lower-case these. The mode is actually  
called "tcl-mode" (not Tcl-mode) in Emacs. Therefore it should be  
lower-cased for clarity.

> I don't know if it makes a difference, not being an Emacs person,  
> but I think the Mode keyword is supposed to come first.

Actually: no.
In principle it does also not matter, but many put the coding first,  
because that is the order in which that needs to be know. First you  
"decode" the file, then you switch to a mode, then you customize  
that... For vim you actually have the encoding first as well;)

> Also we should probably have file encoding in the modeline

Right, also for vim.

Thus we get this line:

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil;  
c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

Greetings,
Jochen
--
Einigkeit und Recht und Freiheit                http://www.Jochen- 
Kuepper.de
     Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll



_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev

PGP.sig (193 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Source editing standards: Modeline (Re: [28702] trunk/base/HACKING)

Michael Wild-2
Jochen Küpper wrote:

> Please forward to [hidden email], as I am not
> subscribed there  (Cannot post)
>
> On 11.09.2007, at 00:51, Kevin Ballard wrote:
>
>>>     Any objections to those? Something to add? Is casing of keywords
>>> right (Tcl or tcl)?
>
> Shouldn't matter; personally I lower-case these. The mode is actually
> called "tcl-mode" (not Tcl-mode) in Emacs. Therefore it should be
> lower-cased for clarity.
>
>> I don't know if it makes a difference, not being an Emacs person, but
>> I think the Mode keyword is supposed to come first.
>
> Actually: no.
> In principle it does also not matter, but many put the coding first,
> because that is the order in which that needs to be know. First you
> "decode" the file, then you switch to a mode, then you customize that...
> For vim you actually have the encoding first as well;)
>
>> Also we should probably have file encoding in the modeline
>
> Right, also for vim.
>
> Thus we get this line:
>
> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil;
> c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
>
> Greetings,
> Jochen
>


Hi all

I know it is a bit late, and I'm (still) an outsider, but shouldn't a
filetype directive be included in the vim modeline? Especially for the
Portfiles, as the filetype-plugin identifies them as configuration
files. That would give something like:

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil;
c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

Regards


Michael

_______________________________________________
macports-dev mailing list
[hidden email]
http://lists.macosforge.org/mailman/listinfo/macports-dev