Re: small units

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: small units

Barry Warsaw
On Mar 05, 2010, at 07:00 PM, Andreas Roehler wrote:

>question is: how to edit small units in python-code?
>
>Let's consider piece below from Dive Into Python:
>
>  result = roman71.fromRoman(numeral)
>
>Beside of operators three python-words are here:
>
>result / roman71 / fromRoman(numeral)
>
>which should possible be picked with one command/key.
>Resp. copied, deleted, maybe transposed etc.
Aren't there already key bindings for these.  E.g.

M-f == py-forward-into-nomenclature
M-C-f == forward-sexp

Well you need two keystrokes to get all of 'fromRoman(numeral)' or of course
you could just use

C-e == move-end-of-line

At least, it's never seemed there was anything lacking to me.

-Barry

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: small units

Rohan Nicholls-3
I second this, I find the emacs movement bindings work brilliantly.

And if it is a long line, I use incremental search to navigate.

On Sun, Mar 7, 2010 at 10:53 PM, Barry Warsaw <[hidden email]> wrote:

> On Mar 05, 2010, at 07:00 PM, Andreas Roehler wrote:
>
>>question is: how to edit small units in python-code?
>>
>>Let's consider piece below from Dive Into Python:
>>
>>  result = roman71.fromRoman(numeral)
>>
>>Beside of operators three python-words are here:
>>
>>result / roman71 / fromRoman(numeral)
>>
>>which should possible be picked with one command/key.
>>Resp. copied, deleted, maybe transposed etc.

I am not sure what you mean by one command/key, could you
elaborate?  I am curious what you are searching for.

Have you seen this functionality elsewhere?  Could you give
a specific example?


Thanks,
Rohan
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: small units

Andreas Röhler-2
In reply to this post by Barry Warsaw
Barry Warsaw wrote:

> On Mar 05, 2010, at 07:00 PM, Andreas Roehler wrote:
>
>> question is: how to edit small units in python-code?
>>
>> Let's consider piece below from Dive Into Python:
>>
>>  result = roman71.fromRoman(numeral)
>>
>> Beside of operators three python-words are here:
>>
>> result / roman71 / fromRoman(numeral)
>>
>> which should possible be picked with one command/key.
>> Resp. copied, deleted, maybe transposed etc.
>
> Aren't there already key bindings for these.  E.g.
>
> M-f == py-forward-into-nomenclature


that's ok

Python-units, `python-expressions' finally, behaves different:

1) it selects and highlights the item
2) stops at the beginning, resp. the last char of item
3) takes the item into the kill-ring when interactively called
4) provides a series of related commands, reports, hiding etc.


> M-C-f == forward-sexp


Shows occasionally unpredictable behaviour, for example

    def __init__(self, d={}):
__________________________|______
        self._keys = d.keys()
        dict.__init__(self, d)

If cursor is under closing brace

forward-sexp: Scan error: "Containing expression ends prematurely", 565, 566

`ar-forward-python-expression-atpt' in contrast would move to the closing `)' with first step, than to the next `self' etc.

BTW seems I have to clean up my launchpad-repo

For the curious, in order to get everything needed, two checkouts seem necessary:

bzr branch lp:~a-roehler/s-x-emacs-werkstatt/thingatpt-python-expressions.el
bzr branch lp:~a-roehler/s-x-emacs-werkstatt/beg-end.el


Andreas



>
> Well you need two keystrokes to get all of 'fromRoman(numeral)' or of course
> you could just use
>
> C-e == move-end-of-line
>
> At least, it's never seemed there was anything lacking to me.
>
> -Barry
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Python-mode mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/python-mode

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode