From andreas.roehler at online.de Wed Sep 15 17:46:32 2010 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Wed, 15 Sep 2010 17:46:32 +0200 Subject: [Python-mode] new branch `python-mode-com Message-ID: <4C90EA58.2010304@online.de> Hi Barry, hi all, new branch `python-mode-components' intends towards a python-IDE as discussed ago. `python-mode-components' enables use of `imenu' in python-buffers. Basiscally it splits up python-mode.el. That should make further editing easier, permitting pydb.el alongside with existing pdb-functions etc. Too the pure number of functions will increase considerable, if realised. Just starting. Maybe all should integrate into CEDET still? See also `thingatpt-python-expressions.el' at https://code.launchpad.net/s-x-emacs-werkstatt/ -- which is fairly experimental. Two minor functions have been added, see below. Comments welcome. Andreas ;;;;;;;;;;;;; (defun py-statement-forward (count) "Like `py-next-statement', but moves to the statements text beginning, returns position. " (interactive "p") (py-next-statement count) (back-to-indentation) (when (interactive-p) (message "%s" (point))) (point)) (defun py-statement-backward (count) "Like `py-previous-statement', but move to the statements text beginning, returns position. " (interactive "p") (py-previous-statement count) (back-to-indentation) (when (interactive-p) (message "%s" (point))) (point)) From barry at python.org Mon Sep 20 16:31:47 2010 From: barry at python.org (Barry Warsaw) Date: Mon, 20 Sep 2010 10:31:47 -0400 Subject: [Python-mode] new branch `python-mode-com In-Reply-To: <4C90EA58.2010304@online.de> References: <4C90EA58.2010304@online.de> Message-ID: <20100920103147.029e8916@mission> On Sep 15, 2010, at 05:46 PM, Andreas R?hler wrote: >Hi Barry, hi all, Hi Andreas, >new branch `python-mode-components' intends >towards a python-IDE as discussed ago. > >`python-mode-components' enables use of `imenu' in >python-buffers. > >Basiscally it splits up python-mode.el. I think it's cool to work on advanced features, maybe even by writing and delivering multiple .el files. I do think however that we want to keep current functionality in one file so that it's very easy for folks to install. >That should make further editing easier, permitting >pydb.el alongside with existing pdb-functions etc. > >Too the pure number of functions will increase >considerable, if realised. > >Just starting. Maybe all should integrate into CEDET still? >See also `thingatpt-python-expressions.el' I don't use CEDET so I don't have too much to say about it. Do what you think is right! -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From andreas.roehler at online.de Tue Sep 21 10:33:46 2010 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Tue, 21 Sep 2010 10:33:46 +0200 Subject: [Python-mode] py-goto-initial-line doku Message-ID: <4C986DEA.1050305@online.de> Hi Barry, hi all, 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. Agreed? Any other opinions? Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/ ;;;;;;;;;;;; (defun py-goto-initial-line () "Go to the initial line of the current statement. Usually this is the line we're on, but if we're on the 2nd or following lines of a continuation block, we need to go up to the first line of the block." ... From barry at python.org Tue Sep 21 20:27:51 2010 From: barry at python.org (Barry Warsaw) Date: Tue, 21 Sep 2010 14:27:51 -0400 Subject: [Python-mode] py-goto-initial-line doku In-Reply-To: <4C986DEA.1050305@online.de> References: <4C986DEA.1050305@online.de> Message-ID: <20100921142751.615af8ee@mission> 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 . 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: From andreas.roehler at online.de Tue Sep 21 21:22:59 2010 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Tue, 21 Sep 2010 21:22:59 +0200 Subject: [Python-mode] py-goto-initial-line doku In-Reply-To: <20100921142751.615af8ee@mission> References: <4C986DEA.1050305@online.de> <20100921142751.615af8ee@mission> Message-ID: <4C990613.3000201@online.de> Am 21.09.2010 20:27, schrieb Barry Warsaw: > 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. > > 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 > > > Thanks, if the lp:~a-roehler/python-mode/tqs-302834-amend branch is merged (?) the patch from lp:~a-roehler/python-mode/py-goto-initial-line should work for you. So I'll take care of the doku with this new head, send another patch then. Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.roehler at online.de Wed Sep 22 11:21:37 2010 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Wed, 22 Sep 2010 11:21:37 +0200 Subject: [Python-mode] py-goto-initial-line doku In-Reply-To: <20100921142751.615af8ee@mission> References: <4C986DEA.1050305@online.de> <20100921142751.615af8ee@mission> Message-ID: <4C99CAA1.3030605@online.de> Am 21.09.2010 20:27, schrieb Barry Warsaw: > 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. > > 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. [...]" > > Proceeding... Will put it into the tqs-amend patch, as you are playing with it. > 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. > Think we can't say that. for example consider the following, which is a simple statement too (?) print """Usage: %s ....""" % ( os.path.basename(sys.argv[0])) So maybe `print' is considered such a uniquely identifying keyword, --assuming not-- what about this: ar_atpt_delimited_list_roh = ([ 'braced ?\{ ?\}', 'bracketed ?\[ ?\]', 'angled-lesser ?\< ?\>', 'angled-greater ?\> ?\<', 'left-right-singlequoted ?\? ?\?', 'parentized ?\( ?\)', ]) Cheers Andreas > 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 > > > > > _______________________________________________ > Python-mode mailing list > Python-mode at python.org > http://mail.python.org/mailman/listinfo/python-mode > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.roehler at online.de Thu Sep 23 10:18:54 2010 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Thu, 23 Sep 2010 10:18:54 +0200 Subject: [Python-mode] py-backslash-continuation-line-p Message-ID: <4C9B0D6E.5030706@online.de> Hi Barry, hi all, replaced in lp:~a-roehler/python-mode/tqs-302834-amend branch, which is expected for a merge next: `py-backslash-continuation-line-p' with `py-backslash-continuation-preceding-line-p' as it addresses preceding line, not current. Adressing the current one might be of some use too, so preserved the name for it. BTW doku adresses the comment issue, which isn't at stake here IMHO "Return t if preceding line ends with backslash that is not in a comment." Better just "Return t if preceding line ends with backslash. " (?) Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/