[Python-mode] edit or navigate code by feature

Andreas Röhler andreas.roehler at online.de
Fri Jul 1 08:48:17 CEST 2011

> When I said something like "get method", I'm using a shorthand that I
> think you would call "get method name".

that's starting with `which' - which-function-mode
works with current trunk. BTW have made the imenu index working. Maybe 
try it and tell if that's of some use or not in your case.

  The vocal command for what you
> are describing would be "get entire method". Using the totally
> fictitious method:
> def simple_method (self, index, string, instance):
> oil_type = string[3:7]
> oil_level = self.tank [index]
> lubricated_device = instance.motor

> when I say "get entire method", I expect the entire method to be
> returned. when I say:

Well, that's called mark, copy, kill, borders-of etc.

> "get method" Return one of the following (tank, motor).
> "get instance" Return one of the following (self, instance).

OK, noted as a task. That's a kind of code inspection. Python itself 
will deliver that.

> "get method definition" Return the following name (simple_method)
> "get first argument  Return self if this command is used while the cursor
> is on the same line as "simple_method"

OK, noted.

> "get index" returns one of the following (3:7, index)
> slightly more complicated versions:
> If the cursor sits on the word type of oil_type and I say "get index" it
> should return a string "3:7" leaving mark at '3' and the cursor (point)
> after '7'.

would call that something like "mark right-hand part of assignement"

>  From the same starting point, if I say "get next index", it should
> return the word "index" leaving the mark on "i" and point after "x"
> from the same starting point,

That's slightly confusing for me. However, think have some point to set 

BTW when writing examples, better use well known, kind of canonical 
example names like "foo", "bar", "baz".

Don't use methods for names like "string" or "index".

  if I say "get last argument" it should
> return the word "instance" leaving mark on'i' of instance and point
> after the 'n'

That's OK. You should get a way traveling arguments of a function.

> I am on the fence about whether or not to return information or strictly
> use these new routines to mark a region and then use the region
> retrievals and change functions. What do you think about that?

It's necessary to discriminate between reports and code-changing actions.

Marking the object prepares changing, but could be optional following 
reports as a kind of hook.

  I'm also
> missing some pronounceable and unique shorthand names for other features.
> --- eric

Please write which you are missing.

So far,


More information about the Python-mode mailing list