[84494] trunk/dports/python/py-psycopg2/Portfile
Ryan Schmidt
ryandesign at macports.org
Mon Sep 26 16:45:57 PDT 2011
On Sep 26, 2011, at 14:22, snc at macports.org wrote:
> Revision: 84494
> http://trac.macports.org/changeset/84494
> Author: snc at macports.org
> Date: 2011-09-26 12:22:20 -0700 (Mon, 26 Sep 2011)
> Log Message:
> -----------
> py-psycopg2: license
You also added the modeline:
> Modified Paths:
> --------------
> trunk/dports/python/py-psycopg2/Portfile
>
> Modified: trunk/dports/python/py-psycopg2/Portfile
> ===================================================================
> --- trunk/dports/python/py-psycopg2/Portfile 2011-09-26 19:17:16 UTC (rev 84493)
> +++ trunk/dports/python/py-psycopg2/Portfile 2011-09-26 19:22:20 UTC (rev 84494)
> @@ -1,3 +1,4 @@
> +# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
When you add the modeline, you should ensure that the portfile actually conforms to the modeline. This modeline states that tabs are expanded to spaces, at 4 spaces per indentation, but this portfile actually contains a mix of that style and actual tab characters intended to be represented at 8-space indents. You can expand the tab characters to spaces as follows:
cd $(port dir py-psycopg2)
svn up
expand -t 8 Portfile > temp
mv temp Portfile
The indents of the formerly tab-using lines then don't quite line up with those of the space-using lines so some manual editing is then needed. Typically you would want to do these whitespace corrections in the same commit in which you add the modeline, but certainly separately from any functional changes, as you know.
You should also use the exact modeline listed here:
http://guide.macports.org/#development.creating-portfile
Your modeline differs in that in the emacs part you added "truncate-lines: t" and in the vim part you omitted "ft=tcl". I imagine the omission of "ft=tcl" was an oversight, since we do want to inform the editor that this is a Tcl file so that it can offer syntax highlighting and perhaps code completion. If you think the addition of "truncate-lines: t" in the vim part is useful you should propose it on macports-dev so that we can consider altering the official modeline to include it (and an equivalent directive in the emacs part, if there is one).
More information about the macports-dev
mailing list