PLEASE READ: Whitespace rules

Kevin Ballard eridius at macports.org
Fri Sep 7 16:19:02 PDT 2007


On Sep 7, 2007, at 7:09 PM, markd at macports.org wrote:

>> # -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic- 
>> offset: 4
>> -*- vim:et:sw=4:ts=4:sts=4
>>
> I have not had time to follow the thread, and I've found out that  
> "soft
> tabs" are tabs emulated with spaces.  But though some are obvious, can
> someone explain what all the elements of the modeline do?  Are any  
> current
> ports using it?  This needs to be documented.

I constructed the modeline myself, so nothing's using it yet (except  
macports1.0/macports.tcl).

There's 2 parts. The first is the -*- stuff -*-, which is for emacs.  
The second starts with vim:

1st part:

Mode: Tcl
sets the emacs mode to Tcl

tab-width: 4
sets the tab width to 4

indent-tabs-mode: nil
use soft tabs (yeah, the name is weird)

c-basic-offset: 4
I don't know if this is necessary, but it declares the auto indent  
width as 4.

2nd part:


vim:
just the prefix that tells vim to use the rest of the line

et
Expand tabs, or use soft tabs

sw=4
shift width = 4, used with the auto indentation mechanism

ts=4
tabstop is 4

sts=4
soft tab stop is 4

-- 
Kevin Ballard
http://kevin.sb.org
eridius at macports.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-dev/attachments/20070907/980bc7b5/attachment.html


More information about the macports-dev mailing list