emacs alphabetize methods

Peter Milliken peterm at resmed.com.au
Sun May 9 18:28:57 EDT 2004


Not that I am aware of - but this wouldn't be an impossible job to tackle
yourself and provide the results for benefit of the rest of us who uses
Emacs :-)

My suggestion for how to do this (off the top of my head :-)) is to write a
support (Python) program to call from your emacs using Pymacs
(http://pymacs.progiciels-bpi.ca/manual/The--Pymacs--buffer.html).

Then you could probably locate the points where your methods start and
finish using services available from the Python Language Services section in
the Python Library Reference (Chapter 18), re-arrange the source code and
then re-insert it back into your Python buffer.

Probably not a very big job at all - if you don't do it then I might well do
it myself one day (but not in the foreseeable future due to other work loads
:-)).

Regards,
Peter

"John Hunter" <jdhunter at ace.bsd.uchicago.edu> wrote in message
news:mailman.377.1084133181.25742.python-list at python.org...
>
> Using emacs python-mode with a class
>
> class C:
>     def method1(self):
>         pass
>
>     def anothermethod(self):
>         pass
>
>     def method2(self):
>         pass
>
> is there any way to select all the methods and have emacs order them
> alphabetically?  If not, is there a good too to do so?
>
> Thanks,
> John Hunter
>





More information about the Python-list mailing list