[Python-mode] py-goto-initial-line doku
Barry Warsaw
barry at python.org
Tue Sep 21 20:27:51 CEST 2010
On Sep 21, 2010, at 10:33 AM, Andreas Röhler wrote:
>suggest to drop the second sentence in doku of
>`py-goto-initial-line' --see below-- as it's confusing.
>
>"Usually this is the line we're on" might be true, but
>has no syntactic relevance.
>
>It's not obvious, what "a continuation block" should mean.
>
>For me a block is the body of a conditional.
Well, almost the entire docstring makes no sense <wink>.
The Python language reference describes these things as "compound statements":
http://docs.python.org/reference/compound_stmts.html
It goes on to describe the layout of compound statements:
"Compound statements consist of one or more ‘clauses.’ A clause consists
of a header and a ‘suite.’ The clause headers of a particular compound
statement are all at the same indentation level. Each clause header begins
with a uniquely identifying keyword and ends with a colon. A suite is a
group of statements controlled by a clause. A suite can be one or more
semicolon-separated simple statements on the same line as the header,
following the header’s colon, or it can be one or more indented statements
on subsequent lines. [...]"
So, how's this for a suggested new docstring:
"Go to the initial line of the current statement.
When point is on a simple statement, this will go to the start of that line.
When point is on a line inside a compound statement, this will go to the line
that introduces the suite, i.e. the clause header."
If you wanted, you could also add a reference to the online docs for compound
statements given above.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-mode/attachments/20100921/c48ad408/attachment.pgp>
More information about the Python-mode
mailing list