py-goto-block-up

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

py-goto-block-up

Andreas Röhler-2

Hi Barry,

trying to keep some experimental implementations synced
semantically, I'm stumbling about the following:

py-goto-block-up (&optional nomark)
  "Move up to start of current block.
Go to the statement that starts the smallest enclosing block; roughly
speaking, this will be the closest preceding statement that ends with a
colon and is indented less than the statement you started on....
"

IMHO it should rather be named into something like
`py-goto-beginning-of-block'

while `py-goto-block-up' indicates a higher level.

(?)

Cheers

Andreas

--
https://code.launchpad.net/~a-roehler/python-mode
https://code.launchpad.net/s-x-emacs-werkstatt/

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

Re: py-goto-block-up

Eric S. Johansson
On 4/16/2010 5:27 AM, Andreas Roehler wrote:

>
> Hi Barry,
>
> trying to keep some experimental implementations synced
> semantically, I'm stumbling about the following:
>
> py-goto-block-up (&optional nomark)
>    "Move up to start of current block.
> Go to the statement that starts the smallest enclosing block; roughly
> speaking, this will be the closest preceding statement that ends with a
> colon and is indented less than the statement you started on....
> "
>
> IMHO it should rather be named into something like
> `py-goto-beginning-of-block'
>
> while `py-goto-block-up' indicates a higher level.

excellent. do need to work on the naming a bit. As this is two dimensional
navigation. Previous and next four blocks earlier and later the file and in
versus out for nesting depth.

block-out
block-in
block-previous
block-next
block-previous-out
block-previous-in
block-next-out
block-next-in

the first two (block-in/out) would navigate strictly on indentation.  the second
two, navigate strictly  on blocks independent of indentation. For example, if
you have three blocks at the same level, it will go to the previous block and
not the fourth block which is outdented. The third pair previous-out/in
navigates to the previous block that is either outdented or indented
respectively. The third pair next out/in navigates to the next block that is
either outdented or indented respectively.

one additional level of usefulness would be to not just do a go to but also do a
push to so you can return to where you had left off.

Personally, I moving the mouse or pen to point to the right word, expression or
whatever and say something like

"<goto | push to| select | replace> [count] <character | word | line | matched |
expression>"

Might be a bit rough to deal with if you are not talking to your computer (even
if you are saying *%*^%^$%) but it's a good starting point for navigational
functionality for programming.
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: py-goto-block-up

Barry Warsaw
In reply to this post by Andreas Röhler-2
On Apr 16, 2010, at 11:27 AM, Andreas Roehler wrote:

>trying to keep some experimental implementations synced
>semantically, I'm stumbling about the following:
>
>py-goto-block-up (&optional nomark)
>  "Move up to start of current block.
>Go to the statement that starts the smallest enclosing block; roughly
>speaking, this will be the closest preceding statement that ends with a
>colon and is indented less than the statement you started on....
>"
>
>IMHO it should rather be named into something like
>`py-goto-beginning-of-block'
>
>while `py-goto-block-up' indicates a higher level.
Sure, I think this renaming makes sense.  FWIW, I rarely use this command. ;)

-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: py-goto-block-up

Barry Warsaw-5
In reply to this post by Eric S. Johansson
On Apr 16, 2010, at 10:03 AM, Eric S. Johansson wrote:

>excellent. do need to work on the naming a bit. As this is two dimensional
>navigation. Previous and next four blocks earlier and later the file and in
>versus out for nesting depth.
>
>block-out
>block-in
>block-previous
>block-next
>block-previous-out
>block-previous-in
>block-next-out
>block-next-in
I dunno.  If it's useful to people sure, but I doubt I'd use them much.
Sometimes it's just quicker to use C-n and C-p y'know? :)

-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: py-goto-block-up

Eric S. Johansson
On 4/16/2010 2:28 PM, Barry Warsaw wrote:
> On Apr 16, 2010, at 10:03 AM, Eric S. Johansson wrote:

> I dunno.  If it's useful to people sure, but I doubt I'd use them much.
> Sometimes it's just quicker to use C-n and C-p y'know? :)

well duh, if you have working hands it certainly is easier.  like some of my
similarly disabled brethren and cistern[sic], I find it far easier to move the
mouse into the vicinity and then tell to do what I want to do. For example, go
to hear or push to hear is far easier than saying move up three lines and then
move lost for words. After series of commands like that, I expect to hear "you
sunk my battleship". At the same time, looking at the output of a Python stack
trace, saying "go to line three five zero" is far easier than scrolling or paging.

User interfaces aren't easy. Especially when people deviate from capabilities
and endurance of a 20-year-old.

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

Re: py-goto-block-up

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

> On Apr 16, 2010, at 11:27 AM, Andreas Roehler wrote:
>
>> trying to keep some experimental implementations synced
>> semantically, I'm stumbling about the following:
>>
>> py-goto-block-up (&optional nomark)
>>  "Move up to start of current block.
>> Go to the statement that starts the smallest enclosing block; roughly
>> speaking, this will be the closest preceding statement that ends with a
>> colon and is indented less than the statement you started on....
>> "
>>
>> IMHO it should rather be named into something like
>> `py-goto-beginning-of-block'
>>
>> while `py-goto-block-up' indicates a higher level.
>
> Sure, I think this renaming makes sense.

OK, thanks. So I'll make a branch.

 FWIW, I rarely use this command. ;)
>
> -Barry

I'm reflecting a set of commands following example of paredit.el's
Depth-Changing Commands etc.

http://mumble.net/~campbell/emacs/paredit/paredit.html

Things like `paredit-splice-sexp-killing-backward'
Just saying "block" where paredit.el says "list".

Andreas

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

Re: py-goto-block-up

Barry Warsaw
In reply to this post by Eric S. Johansson
On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote:

>User interfaces aren't easy. Especially when people deviate from capabilities
>and endurance of a 20-year-old.

Trust me, I am very deviant from the capabilities and endurance of a 20 year
old. :)

-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: py-goto-block-up

Eric S. Johansson
On 4/19/2010 4:23 PM, Barry Warsaw wrote:
> On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote:
>
>> User interfaces aren't easy. Especially when people deviate from capabilities
>> and endurance of a 20-year-old.
>
> Trust me, I am very deviant from the capabilities and endurance of a 20 year
> old. :)
>

yea well, I'm more of a deviant than you are. Oh wait a minute, did I say that
out loud?

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

Re: py-goto-block-up

Barry Warsaw
On Apr 19, 2010, at 04:54 PM, Eric S. Johansson wrote:

>On 4/19/2010 4:23 PM, Barry Warsaw wrote:
>> On Apr 16, 2010, at 10:56 PM, Eric S. Johansson wrote:
>>
>>> User interfaces aren't easy. Especially when people deviate from capabilities
>>> and endurance of a 20-year-old.
>>
>> Trust me, I am very deviant from the capabilities and endurance of a 20 year
>> old. :)
>>
>
>yea well, I'm more of a deviant than you are. Oh wait a minute, did I say that
>out loud?
>
>:-)
Do you have pictures to prove it? :)

-B

_______________________________________________
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: py-goto-block-up

Eric S. Johansson
On 4/19/2010 6:12 PM, Barry Warsaw wrote:

>
> Do you have pictures to prove it? :)

(did you really think I could let a comment like that lie unanswered :-)

no, but I do have stories which are really not appropriate for the mailing list
(definitely nsfw^2). One thin hint I'll give you is a.s.b and the little blue
guy a.k.a. fpf.

and now back to your regularly scheduled program. any further queries should be
direct e-mail.
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode