emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which Function mode and Python mode


From: Paul Pogonyshev
Subject: Re: Which Function mode and Python mode
Date: Sun, 1 Jul 2007 00:11:16 +0300
User-agent: KMail/1.7.2

Stefan Monnier wrote:
> > This short patch adds support for Which Function minor mode to Python
> > mode.  It also adds Python mode to the default list of modes where
> > Which Function mode is in effect.
> 
> How does your code compare to the result you get with the default which-func
> support, which relies on imenu's data?

class SomeClass (object):
    class Nested (object):
        def __init__(self):
            pass

Put the point on `pass' line.  With my code: "SomeClass.Nested.__init__".
With original imenu-dependent code: " class SomeClass".

I personally see this as an improvement.  With imenu approach it is
necessary to regenerate the menu, as far as I understand.  I personally
see little value in having "class X" in mode line, I'm more interested
in which exactly method of that classn the point is.  Finally, "class"
is probably redundant, because at least with standard Python naming
scheme, it is very easy to tell classes and methods/functions just by
their names.

Still, I agree it is somewhat of code duplication.  I was not aware
there was imenu approach.  It never manifested itself on my Python
buffers mode lines...

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]