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

Michael Wild themiwi at gmail.com
Wed Sep 19 07:07:04 PDT 2007


Jochen Küpper wrote:
> Please forward to macports-dev at lists.macosforge.org, 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




More information about the macports-dev mailing list